ASP.NET MVC Model - Strange Behaviour
I'm pulling my hair out with this one. I'm getting the build error everytime my repository or form view model references aspnet_UsersInRoles:
Error 8 'Emas.Model.aspnet_User' does not contain a definition for 'aspnet_UsersInRoles' and no extension method 'aspnet_UsersInRoles' accepting a first argument of type 'Emas.Model.aspnet_User' could be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\Administrator\Desktop\IRenewables_EMAS\IRenewables_EMAS\Models\Re开发者_Go百科positories\SecurityRepository.cs 57 22 IRenewables_EMAS
This is really odd because when I loop into my Model everything is fine the relationship is on place. I've tried everything i can think of, removing the object from the model and refreshing, then dragging it back in etc etc.
The only thing i did different with this MVC App is I have decided to drop the GUID field from UserId. I don't think its anything to do with that - something more simple. Should be a simple obvious fix this but i'm going babanas with this one - any suggestions greatly appreciated.
Cheers
Sussed it, I did not have a compound primary key set on the aspnet_Roles table, DOH
精彩评论