ASP.NET MVC CRUD(Create/Update/Delete) With Dapper ORM
Hi All,
Here's an ASP.NET MVC CRUD(Create/Update/Delete) project with Dapper ORM. The model classes and interface are based from this post Using Dapper ORM in ASP.NET Web Forms with few modifications in Customer class. The updates are adding Display attribute and DisplayFormat attribute to CreditLimit and IntroDate properties.
Output
See VB.NET version of this article here: ASP.NET MVC CRUD(Create/Update/Delete) With Dapper ORM in VB.NET
The source code and Create table script are available in Github ASP.NET MVC With Dapper.
Cheers!
using System; using System.ComponentModel.DataAnnotations; namespace ASPMVCDapper.Models { public class Customer { public int CustomerID { get; set; } [Display(Name="Company Name")] public string CompanyName { get; set; } [Display(Name = "Address")] public string Address { get; set; } [Display(Name = "City")] public string City { get; set; } [Display(Name = "State")] public string State { get; set; } [Display(Name = "Intro Date")] [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)] public DateTime IntroDate { get; set; } [Display(Name = "Credit Limit")] [DisplayFormat(DataFormatString = "{0:n2}")] public decimal CreditLimit { get; set; } } }
See VB.NET version of this article here: ASP.NET MVC CRUD(Create/Update/Delete) With Dapper ORM in VB.NET
The source code and Create table script are available in Github ASP.NET MVC With Dapper.
Cheers!
Comments
Post a Comment