首页 \ 问答 \ 使用ASP.NET 5的N层架构(MVC 6)(N-Tier Architecture using ASP.NET 5 ( MVC 6 ))

使用ASP.NET 5的N层架构(MVC 6)(N-Tier Architecture using ASP.NET 5 ( MVC 6 ))

我正在阅读有关ASP.NET核心功能的内容,我决定将当前的解决方案(MVC 5)转移到MVC 6,但我对集成DI有点困惑。 目前我有这个架构

目前的架构

CemaManager(代表层)引用了Helpers,Resource,ViewModel和BLL。 Bll引用了ViewModel,Database和DLL。 Dll引用了Database。

使用DI和存储库模式的典型N层架构。

当我调查MVC6时,有启动器,其中DI初始化。 这意味着如果我想分离BLL和DAL,它们将全部引用MVC6并且所有逻辑都将通过该层? 到时候它会变得沉重,难以维持和扩展,还是我错了?

有没有办法将startup.cs或DI方法导出到另一层? 也许有人知道要阅读的文章或例子?


I was reading about ASP.NET Core features and I decide to transfer my current solution ( MVC 5 ) to MVC 6 but I got a little bit confused regarding integrated DI. Currently I have this architecture

Current architecture

CemaManager ( representative layer ) has reference to Helpers, Resource, ViewModel and BLL. Bll has reference to ViewModel, Database and DLL. Dll has reference to Database.

Typical N-tier architecture using DI and Repository pattern.

When I investigate MVC6 there is startup.cs where DI initialize. That means if I want to separate BLL and DAL they will have all reference to MVC6 and all logic will go thru that layer? By the time It's gonna be heavy and hard to maintain and scale or am I wrong?

Is there any way to export startup.cs or DI method to another layer? Maybe somebody know any articles to read or examples?


原文:https://stackoverflow.com/questions/38460281
更新时间:2022-07-28 10:07

最满意答案

在这种情况下,他们很可能会触发错误并中止离开他们的状态。 由于没有触发他们开始执行,他们只是坐在那里什么都不做。 默认选项是AbandonAndSuspend,因此您可以恢复它们。 您需要找出导致它们出错的原因,通常您可以在跟踪信息中看到它。


相关问答

更多
  • spare_memory_on_machine / memory_footprint_of_crawler_process * 0.95 spare_memory_on_machine / memory_footprint_of_crawler_process * 0.95
  • 这个: >>> @singleton >>> class cls(object): ... pass 相当于: >>> class cls(object): ... pass >>> cls = singleton( cls ) singleton每个类只运行一次(不是每次实例化)。 它返回的函数,每次调用singleton都是get_instance的不同实例,每次实例化运行一次。 因此,即使您尝试实例化许多cls对象,也只会创建一个instances对象。 注意在上面之后实际上是什么类型 ...
  • 嗯......我不确定这是最好的方法,但这是对你所拥有的东西的直接改进。 特别是,我认为使用相关类型会使事情更清晰...... {-# LANGUAGE TypeFamilies, ConstraintKinds, FlexibleInstances, TypeFamilyDependencies #-} import GHC.Exts (Constraint) class CategoryLike p where ty ...
  • 我将在Selenium-Users google论坛上总结我发布的对同一问题的回复 在网格模式下调用Driver.quit()时,会发生以下情况: 客户端(运行测试方法的JVM)向Hub发送删除会话请求。 集线器将删除会话请求转发到相应的节点。 在节点上,selenium独立jar将删除会话请求转换为对DriverCommandExecutor.execute()的调用,然后将其转发到DriverService.stop() DriverService.stop()内部触发对http://localhost ...
  • 您可以清除click事件内部的间隔。 var colorInterval; $($li).on('click', function() { clearInterval(colorInterval); colorClick($(this)); }); //Your other code colorInterval = setInterval(function() { //Rest of your code }); You could just clear the interval ins ...
  • 发现了如何解决这个问题。 首先,显然我试图让我的桌面PC上的实例工作,但这也有我的Eclipse开发环境,我意识到Eclipse工作区可能还有其他的context.xml文件。 我修改了这些以匹配我的Tomcat的context.xml文件,这进一步处理了这个问题。 其次,我有两个同一个servlet的数据,即在同一个Tomcat中运行的Test and Live(Web服务端点URL略有不同),因此显然是同一台机器。 我发现当没有实现SSL时这种方法没有问题,但是当实现SSL时,只有一个servlet实例 ...
  • 实例方法是可以在类的实例上调用的方法,并使用“ - ”字符定义: - (void)instanceMethod; 类方法是一种不需要类实例的方法,可以在类本身上调用(用'+'定义): + (void)classMethod; 您被问到的问题是如果在类上调用实例方法会发生什么,反之亦然(类的实例上的类方法): [NSDate timeIntervalSince1970]; // Instance method (timeIntervalSince1970) called on the class itse ...
  • -(void)renderZombieWithX:(int)xCoord andY:(int)yCoord { NSBezierPath * path = [NSBezierPath bezierPath]; [path setLineWidth:4]; NSPoint center = {xCoord,yCoord}; [path moveToPoint: center]; [path appendBezierPathWithArcWithCenter:center ...
  • 在这种情况下,他们很可能会触发错误并中止离开他们的状态。 由于没有触发他们开始执行,他们只是坐在那里什么都不做。 默认选项是AbandonAndSuspend,因此您可以恢复它们。 您需要找出导致它们出错的原因,通常您可以在跟踪信息中看到它。 Solution is here: AppFabric / WF 4.0 instances stuck despite no bookmark and pending timer
  • 如果您可以修改RunAsync ,使用我们现在拥有的(.NET 4)和即将发生的事情(现在当您考虑它时,.NET 4.5),我将使用任务并行库(TPL)并从中返回某种Task对象RunAsync 。 然后,您可以轻松地告知已完成的操作和正在运行的内容,并使用内置的TPL负载平衡来限制正在运行的任务的数量。 或者,如果您有该方法的非异步版本,您还可以使用TPL的Parallel.ForEach来调用该方法,它将处理负载平衡并且一次只运行足够的方法以避免性能问题 If you can modify RunAsy ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)