使用一个模型类的变量进入另一个模型类 [英] use the variables of one model class into another model class
问题描述
我可以在ASP.net MVC3中将一个模型类的变量用于另一个模型类吗?
如果可以,如何??????
我的意思是
假设我在Model中有三个类,分别是Login,User,Company ...
我也用与数据库中相同的名称声明了User和Company的变量.
现在,
我想将用户类的变量用于登录类,而无需为登录设计表,也不需要新的变量...
这样我就可以使用User Class的变量在登录页面中进行登录验证..
我希望你能理解...
现在引导我...
看到这个链接http://forums.asp.net/t/1802181.aspx/1吗?最后是否+ not + contain + a + definition +
can i use the variables of one model class into another model class in ASP.net MVC3
If so How?????
I mean,
Let us say i have three classes in Model namely Login, User, Company...
I declared the variables for User and Company too with same names as that are in my db.
Now,
I want to use the variables of user class into Login Class without desinging table for Login and without new variables...
so that i will do login validations in the login page with the variables of User Class..
I hope u understand it...
Now guide me...
see once this link http://forums.asp.net/t/1802181.aspx/1?Does+not+contain+a+definition+
推荐答案
ya终于..
我完成了任务....
并感谢您对我的支持
ya finally..
i got my task completed....
and thanks for supporting me
这篇关于使用一个模型类的变量进入另一个模型类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!