This project is read-only.
Using current membership you can extend User entity with your own that you need for your business logic. All this field would be saved to the same collection. To do this you need:
  1. Create class that would represent user in your system and add any fields you want. This class must be inherited from MembershipAccountBase.
    public class SampleUserProfile : MembershipAccountBase
    {
        public string Email { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
    }
  1. To do CRUD operations and more you need to create userservice. For this use code snippet:
     public interface IUsersService : IBaseService<SampleUserProfile>
     {
     }

    public class DefaultUsersService : BaseUsersService<SampleUserProfile>, IUsersService
    {
        public DefaultUsersService(string connectionString)
            : base(connectionString)
        {

        }
    }

  1. When you are done with all this you can use it. Here is sample of usage:
    // ConnectonString sample format mongodb://127.0.0.1/{database_name}
    DefaultUsersService service = new DefaultUsersService("ConnectionString"); 
    SampleUserProfile profile = new SampleUserProfile();
    profile.UserName = model.UserName;
    profile.FirstName = "Dmitriy";
    profile.LastName = "Doe";
    service.Save(profile);


That's it. Have a fun :)

Last edited Aug 3, 2013 at 8:09 AM by F0rc0sigan, version 4

Comments

No comments yet.