asp.mvc model design

前端 未结 4 1968
鱼传尺愫
鱼传尺愫 2021-01-14 21:21

I am pretty new to MVC and I am looking for a way to design my models.

I have the MVC web site project and another class library that takes care of data access and c

4条回答
  •  粉色の甜心
    2021-01-14 21:41

    If it is exactly the same project then obviously don't need to duplicate the Project class, just use it as is in the view. But in real life often views have specific requirements and it it a good practice to define view model classes in your MVC application. The controller will then map between the model class and the view model to be passed to the view.

提交回复
热议问题