Dapper ORM example in ASP.Net MVC Project-VBForums
Results 1 to 3 of 3

Thread: Dapper ORM example in ASP.Net MVC Project

Threaded View

  1. #1

    Thread Starter
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    1,886

    Dapper ORM example in ASP.Net MVC Project

    Good day!

    Using the classes from the post ASP.NET Web Forms Project Using Dapper ORM with Dapper ORM features, this article demonstrates on how to use them in an ASP.NET MVC Project. I made some changes in Customer.cs class by applying DataAnnotations attributes such as Display and DisplayFormat.

    Code:
     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; }
    }
    Name:  DapperMVC.jpg
Views: 2943
Size:  38.9 KB

    Source code: ASP.NET MVC Dapper (Github)

    Regards,
    Last edited by KGComputers; Feb 24th, 2017 at 10:24 AM. Reason: typo
    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: My Blog | GitHub Repo | ASP Snippets | CodeASP.net
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.