Click here to Skip to main content
13,199,318 members (62,717 online)
Rate this:
Please Sign up or sign in to vote.

I'm doing some experiments, trying to model some stuff using Entity Framework, in purpose to eventually learn how to work with it and its many features...

Imagine having an entity in your application, which is your Application's User. The user can authenticate in several different methods (Using Email, Facebook, Twitter, etc.), I personally follow the following rules:
1. A User must have at least a single authentication method through which he is registered.
2. Multiple authentication methods can be applied to match the same user.
3. Each authentication method is stored separately along with its parameters.
4. Typically if we add a new authentication method to our app, we wouldn't like to change existing entities.

I have written a generic algorithms which register/authenticate a user using any authentication method, assuming an authentication entity which implements an interface (the only thing in common among all authentication method is the existence of a user identifier).

Now, I would like to do the same using EF. I want to create an set of entities, each entity holds the information required for the authentication to take place and connects the authenticating user to its profile. Of course that I could do it naively, and write way too much code.

What is the optimal way to do so using EF?

Thanks A Lot!
Posted 11-Jan-13 9:33am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You can start with some basic stuff for Entity Framework like here.[^] These tutorial will help you to build the required entities.

Also MSDN do have video tutorials here.[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.171020.1 | Last Updated 12 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100