Search code examples
asp.net-mvc-4forms-authenticationmembership-provider

Adding List<T> property to ASP.net MembershipUser object MVC 4


I have created ASP.net MVC4 application with Internet application template, and want to add List<T> property to MembershipUser object provided by ASP builtin Forms Authetication.

This List property will be a list of StockPermission object:

public class StockPermission

    {

        private Stock stock;        
        private byte afterSaveAction;        
        private bool allowEditingStockDocs;
        private bool allowChangingUser;
    }

Therefore my MembershipUser will contain StockPermission objects which let MembershipUser to perform defined action with those Stocks in the List


Solution

  • To add List property to our MembershipUser object or any other properties we can create custom MembershipProvider and custom MembershipUser classes describer in this article:

    http://msdn.microsoft.com/en-us/library/ms366730(v=vs.100).aspx