MySql Simple

Simplifying processes in your .NET Core MVC application

Sample code

The following is a sample code to set up a form and submission using the library.

Your model:

    class Employee {

        [MaxLength(40, ErrorMessage = "Name is too long")]
        public string Name { get; set; }

        [Display(Name = "Employee title")]
        public string Title { get; set; }


Your razor form:

<form data-form-submit="@Url.Action("Add")" data-ng-success-url="@Url.Content("~/completed")">
    @{ var i = Html.getInputMaker<Employee>(); }
    @i.Make(m => m.Name)
    @i.Make(m => m.Title)

And finally your controller action:

public IActionResult Add(Employee employee) => employee.Add();