Tim Coker
Tim Coker

Reputation: 6524

Migrating between ASP.Net's built in profile provider to something else

I'm working on a project that needs to get up as quickly as possible. My plan is to use ASP.Net's profile providers to quickly get something up then possibly revisit later as needed. My question is how difficult is it to migrate between the built in profile provider to my own custom schema? Should I bite the bullet and do a custom profile provider now? What are the possible caveats on this going forward?

Upvotes: 0

Views: 111

Answers (1)

David East
David East

Reputation: 32604

I have gone down this path before myself.

It's actually not too bad, but it's really tedious. Since you're implementing the interface, you have a big list of methods to write yourself.

The most tedious part is testing your own version and making sure it works the way it is expected to.

If your project needs to get up fast, just go with what is currently ready to use. You won't hate yourself for going back and changing it later.

Basically what I'm saying is, do you really want to start from here and still create a User Repository after that?

 public class MyProfile : ProfileProvider
 {

    public override int DeleteInactiveProfiles(ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate)
    {
        throw new NotImplementedException();
    }

    public override int DeleteProfiles(string[] usernames)
    {
        throw new NotImplementedException();
    }

    public override int DeleteProfiles(ProfileInfoCollection profiles)
    {
        throw new NotImplementedException();
    }

    public override ProfileInfoCollection FindInactiveProfilesByUserName(ProfileAuthenticationOption authenticationOption, string usernameToMatch, DateTime userInactiveSinceDate, int pageIndex, int pageSize, out int totalRecords)
    {
        throw new NotImplementedException();
    }

    public override ProfileInfoCollection FindProfilesByUserName(ProfileAuthenticationOption authenticationOption, string usernameToMatch, int pageIndex, int pageSize, out int totalRecords)
    {
        throw new NotImplementedException();
    }

    public override ProfileInfoCollection GetAllInactiveProfiles(ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate, int pageIndex, int pageSize, out int totalRecords)
    {
        throw new NotImplementedException();
    }

    public override ProfileInfoCollection GetAllProfiles(ProfileAuthenticationOption authenticationOption, int pageIndex, int pageSize, out int totalRecords)
    {
        throw new NotImplementedException();
    }

    public override int GetNumberOfInactiveProfiles(ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate)
    {
        throw new NotImplementedException();
    }

    public override string ApplicationName
    {
        get
        {
            throw new NotImplementedException();
        }
        set
        {
            throw new NotImplementedException();
        }
    }

    public override System.Configuration.SettingsPropertyValueCollection GetPropertyValues(System.Configuration.SettingsContext context, System.Configuration.SettingsPropertyCollection collection)
    {
        throw new NotImplementedException();
    }

    public override void SetPropertyValues(System.Configuration.SettingsContext context, System.Configuration.SettingsPropertyValueCollection collection)
    {
        throw new NotImplementedException();
    }
}

Upvotes: 1

Related Questions