Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# SQL EF
Hey,
 
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
good
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.[^]
  Permalink  

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

  Print Answers RSS
0 Maciej Los 585
1 OriginalGriff 458
2 CPallini 239
3 Sergey Alexandrovich Kryukov 175
4 Peter Leow 175
0 OriginalGriff 6,092
1 Sergey Alexandrovich Kryukov 4,898
2 Maciej Los 3,159
3 Peter Leow 3,129
4 DamithSL 2,490


Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 12 Jan 2013
Copyright © CodeProject, 1999-2014
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