When I change the method signature to be Task Entity Framework hangs at SaveChanges. Why would this be happening?
This code fails
public async Task<bool> SaveAsync(agency agency)
{
using (var ctx = new AvnEntities())
{
try
{
ctx.agencies.Add(agency);
await ctx.SaveChangesAsync();
return true;
}
catch (System.Exception)
{
return false;
}
}
}
This code works
public async Task SaveAsync(agency agency)
{
using (var ctx = new AvnEntities())
{
try
{
ctx.agencies.Add(agency);
await ctx.SaveChangesAsync();
}
catch (System.Exception)
{
throw;
}
}
}