I have a .net 4.5 WCF. I will rewrite the service implementation to use EF6 to access the database. This service has many customers and many challenges. I can not change the service contract and customers. Does it make sense to use Async EF operations like SaveAsync, at the end my service should return T not Task (due to old clients).
Update
Operating contract
[OperationContract]
public object AddEntity(object entity)
{
using(var context = new MyContext())
{
context.Add(entity)
var task = context.SaveChangesAsync()
return task.Result;
}
}
So even I use async, the thread will be blocked by task. Result. I cannot use this because the operation contract must be changed in order to return the task. How to implement such a scenario?
source
share