I my case I fetched an entity without await
:
var company = _unitOfWork.Session.GetAsync<Company>(id);
and then I tried to delete it:
await _unitOfWork.Session.DeleteAsync(company);
I could not decipher the error message that I'm deleting a Task<Company>
instead of Company
:
MappingException: No persister for: System.Runtime.CompilerServices.AsyncTaskMethodBuilder'1+AsyncStateMachineBox'1[[SmartGuide.Core.Domain.Users.Company, SmartGuide.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null],[NHibernate.Impl.SessionImpl+d__54`1[[SmartGuide.Core.Domain.Users.Company, SmartGuide.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null]], NHibernate, Version=5.3.0.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4]]