Home > Net >  In the EF Core AnyAsync and System. Any Linq
In the EF Core AnyAsync and System. Any Linq

Time:09-16

An asynchronous method in EF Core AnyAsync
But in the System. Linq, there is no asynchronous AnyAsync, only Any

If I had Any outside add Task. Factory. StartNew, the effect of EF Core AnyAsync does
 
Public async Task Login (string name, string PWD)
{
Return await Task. Factory. StartNew (()=& gt; BaseDal. Method GetEntities (.) Any (u=& gt; U.N ame==name & amp; & U.P wd==PWD));
}

Because EF Core belong to DAL layer, and the Login method belongs to the Service layer, is not possible to introduce EF Core Service layer

Or is it write some logic DAL layer?

CodePudding user response:

Code running effect can see it that way, but the actual effect need to look at the source code, how to deal with the internal

Internal request because he is likely to be completely asynchronous,

CodePudding user response:

Reference
because EF Core belong to DAL layer, and the Login method belongs to the Service layer, is not possible to introduce EF Core Service layer

Or is it write some logic DAL layer?


Now seems to have no need to struggle this, heterogeneous multiple language platform development, the parts processing, independent operation, GRPC webapi, thift, websockect is normal

CodePudding user response:

refer to the second floor qq_36786068 response:
reference
because EF Core belong to DAL layer, and the Login method belongs to the Service layer, is not possible to introduce EF Core Service layer

Or is it write some logic DAL layer?


Now seems to have no need to struggle this, heterogeneous multiple language platform development, the parts processing, independent operation, GRPC webapi, thift, websockect is normal

I am to do with a three-tiered architecture, each layer independent, convenient maintenance, after
Has nothing to do with what you say, what language more, not to consider first

CodePudding user response:

Well, you have won, so that put you above all to the core, to talk about maintenance, a core and a net4.5, install a system you put in two frameworks, if how the web iis application pool set version

CodePudding user response:

Now that play with three layers, there seems to be a so-called IDAL, then di IDAL implementation based on the core injection in

Only use above IDAL, seems to be the so-called 3 layers, is how to play

CodePudding user response:

reference 4 floor qq_36786068 response:
well, you have won, so that put you above all to the core, to talk about maintenance, a core and a net4.5, install a system you put in two frameworks, if say what web iis application pool set version

My idea is that use EF Core now as the data access layer query, but if later replaced by other ORM framework, only need to change the DAL layer is good, need not change the Service layer
For platform with.net Core, not to consider..net Framework, so also need not consider IIS deployment
  •  Tags:  
  • LINQ
  • Related