在ASP.Net的内置配置文件提供程序之间进行迁移

时间:2012-06-14 12:12:47

标签: asp.net profile-provider

我正在开展一个需要尽快起床的项目。我的计划是使用ASP.Net的配置文件提供程序快速获取内容,然后根据需要重新访问。我的问题是在内置配置文件提供程序和我自己的自定义架构之间迁移有多难?我现在应该咬紧牙关并做一个自定义配置文件提供商吗?对此有何可能的警告?

1 个答案:

答案 0 :(得分:1)

我在自己面前走了这条道路。

实际上并不太糟糕,但这真的很乏味。由于您正在实现该接口,因此您有很多方法可以自己编写。

最繁琐的部分是测试您自己的版本,并确保它按照预期的方式工作。

如果您的项目需要快速起床,请选择目前可以使用的项目。你不会讨厌回去以后再改变它。

基本上我所说的是,你真的想从这里开始并在此之后仍然创建一个用户资源库吗?

 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();
    }
}
相关问题