0

我正在做一个需要尽快起床的项目。我的计划是使用 ASP.Net 的配置文件提供程序来快速获取某些内容,然后可能会在以后根据需要重新访问。我的问题是在内置配置文件提供程序之间迁移到我自己的自定义架构有多困难?我现在应该硬着头皮做一个自定义配置文件提供程序吗?未来有哪些可能的警告?

4

1 回答 1

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();
    }
}
于 2012-06-14T12:53:21.103 回答