MVC应用的模型方法 [英] Model Approach for MVC Application

查看:66
本文介绍了MVC应用的模型方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在MVC应用程序中创建模型的最佳方法是什么?



假设我们有两个任务的用户主表:登录并更改密码。



请建议我是否应该创建两个单独的登录模式和更改密码,或者可以继续使用单一型号。



请告诉我哪种方法最好?

What is the best way to create model in MVC Application ?

Suppose we have User Master Table for two task : Login and change password.

Please suggest whether i should create two seperate model for login and change password or can continure with single model.

Please tell me which is best approach ?

推荐答案

这里不需要维护两个模型。您可以使用单域模型执行此操作。通常,model表示关系数据库中的数据库表。由于您要为商店用户的数据维护单个表,因此您可以使用单域模型处理上述业务。
You don't need to maintain two models here. You can do this by using the single domain model. Normally, model represents the database Table on your relational database. Since you're maintaining single table for store users' data you can handle above business by using the single domain model.


这篇关于MVC应用的模型方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆