Identity 3.0 Entity Framework Core 1.0 Foreign-Key -
i'm trying wire one-to-many relationship between company
, applicationuser : identityuser
. in applicationuser
class have:
public class applicationuser : identityuser { [foreignkey("companyid")] public int companyid { get; set; } } public class company { [key] public int companyid { get; set; } public string name { get; set; } ... }
but receive system.argumentexception:
microsoft.entityframeworkcore.infrastructure.idbcontextfactory 1[tcontext]' violates constraint of type 'tcontext'
you can setup relation this.
public class applicationuser : identityuser { public company company { get; set; } }
Comments
Post a Comment