如何在N层或DDD中实现异步方法? 。净

时间:2016-07-01 17:15:38

标签: c# .net asynchronous domain-driven-design n-layer

必然,我必须在每一层(DAL,BL,FRONT或Presentation,Services,UnitOfWork等)中实现异步方法吗?

我该怎么办?

选项1:

//Front: 
  - public async method() { //calling await methodMiddle() }
//BL-Domain-Whatever:
  - public async methodMiddle() { //calling await methodDAL() }
//DAL-Persistence-Whatever
  - public async methodDAL()

选项2:

//Front: 
  - public async method() ASYNC { //calling methodMiddle() }
//BL-Domain-Whatever: NO ASYNC
  - public methodMiddle() { //calling methodDAL() }
//DAL-Persistence-Whatever: NO ASYNC
  - public methodDAL() 

先谢谢!!

0 个答案:

没有答案