Donate

ASP.NET MVC CRUD(Create/Update/Delete) With Dapper ORM in VB.NET

Konnichiwa,

Here's a VB.NET ASP.NET MVC CRUD project using Dapper ORM which is the counterpart of this post ASP.NET MVC with Dapper ORM. The only file in the Models folder that has updates is Customer.cs class such as applying Display and DisplayAttributes.
Imports System.ComponentModel.DataAnnotations

Public Class Customer

    Public Property CustomerID() As Integer
        Get
            Return m_CustomerID
        End Get
        Set(value As Integer)
            m_CustomerID = value
        End Set
    End Property
    Private m_CustomerID As Integer

    <Display(Name:="Company Name")>
    Public Property CompanyName() As String
        Get
            Return m_CompanyName
        End Get
        Set(value As String)
            m_CompanyName = value
        End Set
    End Property
    Private m_CompanyName As String

    <Display(Name:="Address")>
    Public Property Address() As String
        Get
            Return m_Address
        End Get
        Set(value As String)
            m_Address = value
        End Set
    End Property
    Private m_Address As String

    <Display(Name:="City")>
    Public Property City() As String
        Get
            Return m_City
        End Get
        Set(value As String)
            m_City = value
        End Set
    End Property
    Private m_City As String

    <Display(Name:="State")>
    Public Property State() As String
        Get
            Return m_State
        End Get
        Set(value As String)
            m_State = value
        End Set
    End Property
    Private m_State As String

    <Display(Name:="Intro Date")>
    <DisplayFormat(DataFormatString:="{0:yyyy-MM-dd}", ApplyFormatInEditMode:=True)>
    Public Property IntroDate() As DateTime
        Get
            Return m_IntroDate
        End Get
        Set(value As DateTime)
            m_IntroDate = value
        End Set
    End Property
    Private m_IntroDate As DateTime

    <Display(Name:="Credit Limit")>
    <DisplayFormat(DataFormatString:="{0:n2}")>
    Public Property CreditLimit() As Decimal
        Get
            Return m_CreditLimit
        End Get
        Set(value As Decimal)
            m_CreditLimit = value
        End Set
    End Property
    Private m_CreditLimit As Decimal

End Class

Output
ASP.NET MVC CRUD(Create/Update/Delete) with Dapper ORM
You may download the project with create table script here Github ASP.NETMVCDapperVB

Cheers!

Comments

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

How To Insert Or Add Emojis In Microsoft Teams Status Message

Bootstrap Modal In ASP.NET MVC With CRUD Operations