ASP.NET MVC 4 with Entity Framework 5 and SimpleMembership integrated into Repository and Unit Of Work pattern

softwareengineering.stackexchange https://softwareengineering.stackexchange.com/questions/188486

  •  05-11-2019
  •  | 
  •  

Question

I have a ASP.NET MVC4 project in which I would like to use the SimpleMembership. The application has a Person table that holds relevant information about users in the system.

I would like a link between the currently logged in user and the Person information. So I have made a foreign key in the Person table to the UserId column of UserProfile table (from SimpleMembership).

I use Entity Framework 5 as ORM and have implemented a generic repository to handle CRUD methods and so on.

Now I am at a point where I want to implement user profile creation. The creation consists of 2 parts parts:

  • login: username and password (to be stored in SimpleMembership tables)
  • personal information (to be stored in Person table)

In order to create a user I guess I need to:

  1. Save user information through SimpleMembership
  2. Save personal information together with userId from step 1 through my PersonRepository

I would like some kind of UserRepository that could save SimpleMembership data but I do not know if it's the right approach? Is there a better approach?

No correct solution

Licensed under: CC-BY-SA with attribution
scroll top