问题描述
大家好,
我有一个空的ASP.net MVC 3应用程序,我使用数据库优先"方法创建了它.
在该数据库中,我有两个带有某些字段的表,它们的名称分别是User和Organization.
现在在模型中,
我创建了三个类,即Login,User,Organization,对于Login类,我在数据库中没有任何表
我用与数据库表中相同的名称声明了变量User和Organization类...
现在,我想在Login类中使用用户和组织变量,并为此将它们声明为Vitual.
后来我添加了控制器和dropdownlist视图包,并查看并运行了它,并提示错误消息如下..
``System.Collections.Generic.IEnumerable< emvc_css.models.modelclasses.user_details_class>''不包含``UName''的定义,也没有扩展方法``UName''接受类型为``System''的第一个参数.可以找到Collections.Generic.IEnumerable< emvc_css.models.modelclasses.user_details_class>''(您是否缺少using指令或程序集引用?)
解决这个问题的任何想法
Hi all,
I have a Empty ASP.net MVC 3 app and i created it by using "Database First" approach.
In that database, i have two tables with some fields and their names are User and Organization.
Now in Model,
i created three classes namely Login, User, Organization, and for Login class i did not have any table in database
and i declared the variables User and Organization classes with same names as that are in database tables...
Now i want to use the user and organization variables into Login class and for that i declared them as Vitual.
later i added the controller and dropdownlist view bag and view and runned it and it is prompting the error message as follows..
''System.Collections.Generic.IEnumerable<emvc_css.models.modelclasses.user_details_class>'' does not contain a definition for ''UName'' and no extension method ''UName'' accepting a first argument of type ''System.Collections.Generic.IEnumerable<emvc_css.models.modelclasses.user_details_class>'' could be found (are you missing a using directive or an assembly reference?)
any idea regading this to solve the problem
推荐答案
这篇关于不包含定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!