ASP .NET MVC 3 Models + stored procedures

前端 未结 4 1419
无人及你
无人及你 2021-02-10 12:35

Im, new in ASP MVC and I don\'t know how to create Models which base on stored procedures from my db. I have already database which works with another application, and my web pa

4条回答
  •  一整个雨季
    2021-02-10 13:07

    Okay, lets say that you have a SP called Customers which is selecting some columns like:

    ID
    Name
    Address

    Now you will create a Model class inside your Model folder called "Customer.cs" and define the properties like:

    public int ID { get; set; }
    public string Name { get; set; }
    public string Address { get; set; }
    

    This is your MODEL class.

提交回复
热议问题