简体   繁体   English

在另一个项目中移动 Asp.net Identity 2

[英]Move the Asp.net Identity 2 in another project

I am creating layered MVC Application that contains.我正在创建包含的分层 MVC 应用程序。

  • model layer: which is not using any reference for EF模型层:不使用任何 EF 参考

  • Data Layer: which contains the infrastructure.数据层:包含基础设施。 (Repositories and unit of work ) and this layer referenced with Entity framework (存储库和工作单元)和实体框架引用的这一层

  • Service layer服务层

  • Web layer.网络层。

在此处输入图片说明

I am using Asp.net identity2.我正在使用 Asp.net identity2。 What I am doing is using ApplicationUser class in model layer and this leads me to reference model layer to Entity framework and Microsoft.AspNet.Identity.EntityFramework .我正在做的是在模型层中使用ApplicationUser类,这使我将模型层引用到Entity frameworkMicrosoft.AspNet.Identity.EntityFramework i am asking if there is a better way to do it, especially in feel that I am repeating my self while making both data layer and model layer using a reference to entity framework?我在问是否有更好的方法来做到这一点,尤其是感觉我在使用对实体框架的引用制作数据层和模型层的同时重复我自己?

I don't think I completely understand your question but consider not mixing your identity model with your domain objects model:我不认为我完全理解您的问题,但考虑不要将您的身份模型与域对象模型混合:

ASP.NET Identity is a presentation layer logic and you have to consider if it's a good idea detaching it from your topmost layer (Web). ASP.NET Identity 是一个表示层逻辑,您必须考虑将它与最顶层 (Web) 分离是否是一个好主意。

I would suggest you keep your Model or Domain project with Entity framework alone and avoid mixing it with objects that are directly related to presentation.我建议您单独使用实体框架保留模型或域项目,并避免将其与与表示直接相关的对象混合使用。

You can take a look at this post: https://aarcoraci.wordpress.com/2017/02/15/asp-net-mvc5-entity-framework-repository-pattern-and-unit-of-work-revisited/你可以看看这篇文章: https : //aarcoraci.wordpress.com/2017/02/15/asp-net-mvc5-entity-framework-repository-pattern-and-unit-of-work-revisited/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ASP.NET Web窗体和标识:将IdentityModels.cs移动到另一个项目 - ASP.NET Web Forms and Identity: Move IdentityModels.cs to another project 无法将ASP.NET身份模型移动到另一个程序集中 - Unable to move ASP.NET Identity model into another assembly Asp.Net样板,如何将样板项目移动到另一台计算机? - Asp.Net boilerplate,, How to Move boilerplate project to another Computer? 在另一个项目中使用asp .net身份用户 - use asp .net identity user in another project 将用户名和密码移动到 ASP.NET Core Identity - Move usernames and passwords to ASP.NET Core Identity ASP Identity 2.0和ASP.NET MVC项目结构 - ASP Identity 2.0 and ASP.NET MVC Project Structure 如何将第三方dll从bin文件夹移动到ASP.NET Web Forms项目中的另一个文件夹? - How to move third party dlls from bin folder to another folder in ASP.NET Web Forms project? 在没有身份验证的情况下创建项目时的ASP.NET Identity Integration - ASP.NET Identity Integration when project is created with no authentication 将使用DbContext的类添加到ASP.NET Identity 2项目 - Adding a class which uses DbContext to ASP.NET Identity 2 project asp.net Identity 2.0可以在自己的项目中运行吗? - Can asp.net identity 2.0 run in it's own project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM