c# - Multiple object sets per type -
i have been trying scaffold usercontroller , views users. @ first, receive errors when scaffolding controller saying: "multiple object sets per type not supported." (this had applicationuser , user) trying scaffold controller in areas/admin.
then followed post @ stackoverflow saying rename applicationuser class user, resulted in lots of errors. changed of references applicationuser user, still got same error. changed applicationuser, tried scaffolding again, in controllers (instead of in areas/admin). seemed work, until ran application. gives me exact same error.
using system.data.entity; using system.security.claims; using system.threading.tasks; using microsoft.aspnet.identity; using microsoft.aspnet.identity.entityframework; namespace impher.models { // can add profile data user adding more properties applicationuser class, please visit http://go.microsoft.com/fwlink/?linkid=317594 learn more. public class applicationuser : identityuser { public string postalcode { get; set; } public async task<claimsidentity> generateuseridentityasync(usermanager<applicationuser> manager) { // note authenticationtype must match 1 defined in cookieauthenticationoptions.authenticationtype var useridentity = await manager.createidentityasync(this, defaultauthenticationtypes.applicationcookie); // add custom user claims here return useridentity; } } public class applicationdbcontext : identitydbcontext<applicationuser> { public applicationdbcontext() : base("defaultconnection", throwifv1schema: false) { } public static applicationdbcontext create() { return new applicationdbcontext(); } public system.data.entity.dbset<impher.models.project> projects { get; set; } public system.data.entity.dbset<impher.models.category> categories { get; set; } public system.data.entity.dbset<impher.models.applicationuser> applicationusers { get; set; } } }
this identitymodels.cs
, can me?
i deleted public system.data.entity.dbset<impher.models.applicationuser> applicationusers {get;set;}
entitymodels.cs
. in userscontroller.cs
, replaces applicationuser users everywhere.
this did trick!
Comments
Post a Comment