在之前的项目中,我使用BrockAllen.MembershipReboot作为我的会员服务提供商,但是,当时没有可用的 NugetPackage,所以我复制了代码并稍微移动了一下。
我有一个看起来像的解决方案。
Solution.Common //database connection helpers, base repos, etc
Solution.DataModels //Contained UserAccount model (I put all datamodels here so I would never have to worry about circular references) All projects depended on this project.
Solution.Authentication //Services, like Add New Account were placed here
Solution.RandomServices
Solution.WebApp //MVC Project (Referenced Solution.Authentication)
好吧,现在我看到我可以通过 NuGet 安装 MembershipReboot。但是,我不确定应该将它安装到哪个项目中。
我当前的项目解决方案如下所示。
Sol.Common //Defines "BaseEntity" which UserAccountModel will need to inherit
Sol.Database //Contains all of the EF Entities, Repositories, and Migrations
Sol.Services //References Sol.Database to connect to repositories for data acess.
Sol.WebApp //References all of the above projects
GitHub 页面上的所有示例都是单项目解决方案。我不确定如何或是否可以使用 Nuget 包来允许 UserAccountModel 继承 BaseEntity。理想情况下,我会让 IUserAccountRepository 存在于 Sol.Database 中,而 UserAccountServices 存在于 Sol.Services 中。