Home > Producers > ASP.NET Identity Producer

ASP.NET Identity Producer

CodeFluent Entities can generate out of the box Membership, Role & Profiles Providers. Recently Microsoft release a new Identity system: ASP.NET Identity. As it seems to be more and more use, we decided to write a new producer to support this new Identity system.

First of all, the source code of the producer is available on our GitHub repository.

The producer does two things:

  • It assists you in creating ASP.NET Identity entities (User, Role, Claim, Login)
  • It generates the UserStore and RoleStore and implements IUser and IRole

How to install

  • Download the code from GitHub and compile it. A compiled version is also available here
  • Copy the output “CodeFluent.Producers.AspNetIdentity.dll” to “C:\Program Files (x86)\SoftFluent\CodeFluent\Modeler”
  • (Optional) To integrate the producer to the graphical modeler copy or merge “custom.config” to “%APPDATA%\CodeFluent.Modeler.Design\custom.config”

How to use it

  1. Create a CodeFluent Entities project
  2. Add a Business Object Model (BOM) producer
  3. Add this new producer (Security -> Asp.Net Identity). Note: The target path has no effect. The target path will be “Target Path of the BOM Producer\Web\Security(User|Role)Store”
  4. Add New Producer

  5. Right click on the producer and click the “Create Identity Entities” menu item
  6. Create Identity Entities

  7. Select necessary entities (User, Role, Claim, Login) and the destination namespace
  8. ASP.NET Identity

  9. Customize entities. For example you can remove “Password” property if you don’t need it
  10. ASP.NET Identity Model

  11. Generate and use the code 🙂

Note: you must add the “Microsoft.AspNet.Identity.Core” Nuget package before compiling the generated code (but this is obvious).

CodeFluent Entities is very extensible. As we try to show in this article, one way of extending it is by using producers. Of course the main goal of producers is to generate code. But they can also interact with the model at design time thanks to the CodeFluent Entities API.

Please share your feedbacks about this producer and don’t hesitate to make some suggestion.

Happy coding!

The R&D Team.

Categories: Producers Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s