« first day (572 days earlier)      last day (1206 days later) » 

2:18 AM
Howdy all! I am working in an MVC project with an entity project attached. I have migrated the Identity functionality into that entity project in order to make more concrete references between Users and my custom entities (e.g. User.Companies and Company.Users).
My conundrum is this, if I look a user up using the UserManager and add a company to their virtual property, how can I save that relationship?
some methods on my user class that defines how I want to add the items (as these are actually a hierarchy of items and thus require rules about what to add.
Do I detach the user, attach it to a new context instance and go from there, or is there some way of getting the context from the UserManager somehow?
 
 
1 hour later…
3:31 AM
Figured it out. In the UserManager property, I can use the OwinContext to get the IdentityContext that it is using.
So long as I only use that context when adding and removing related entities, everything will save.
 

« first day (572 days earlier)      last day (1206 days later) »