Search code examples
c#asp.netasp.net-mvc-3asp.net-membershipasp.net-profiles

How to tie custom properties to a registered user in C#/asp.net MVC 4


Say there are three roles, namely:

  • Registered
  • Administrator
  • Sponsor

I'd like users to be able to self-register as Registered (easy enough out-of-box). I'd like an Administrator to be able to see all registered users and check off the "Sponsor" checkbox, making the user a Sponsor.

Once the user is "checked" as a Sponsor, the Administrator should be able to add additional parameters for the Sponsor, including logo and Sponsor URL, which webpage(s) they are sponsoring, the valid date range for the sponsorship by webpage, the number of impressions and clicks, and also "paid/not paid".

I'm trying to wrap my head around Memberships and Profiles, and see how they apply to this.

Can anyone provide a general framework as to how I can properly architect this? Are there Nuget packages to do just this?

Advice appreciated.


Solution

  • Maybe my answer to another question will help a bit Using out of the box aspnet membership for public facing website

    In Nuget - Thinktecture.IdentityModel is a way to go.