0

I don't like the Code-First-approach and want to make use of the new Identity-Features with my EF-mapped classes. I've got a table User with the columns

  • Id (bigint, ai, pk)
  • Login (nvarchar)
  • Password (nvarchar)

The Interface Microsoft.AspNet.Identity.IUser enforces 2 properties:

  • Id (string)
  • UserName (string)

What, if I don't want to use this structure but I also want to do identity the right way?

Alexander Schmidt
  • 5,631
  • 4
  • 39
  • 79

1 Answers1

1

I found out that starting with ASP.NET Identity 2 (still in prerelease) you can do:

public class MyUser : IdentityUser<long>

Its a little bit more than that when it comes to real life. I blogged about it at codingfreaks (German) and added an English Screencast at Youtube. You can find some good hints here.

So, it is possible.

Alexander Schmidt
  • 5,631
  • 4
  • 39
  • 79
  • i am also having my own tables whether need to include all the columns from asp.net identity table – SivaRajini Apr 29 '16 at 11:20
  • http://stackoverflow.com/questions/36929767/asp-net-identity-entity-framework-database-first-approach-with-own-table-definti – SivaRajini Apr 29 '16 at 11:20