I'm getting this error when I try to convert Task<decimal> to decimal:
Could not load file or assembly 'EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Here is my method:
public async Task<decimal> GetTotalProposalAmount()
{
using (DataContext db = new DataContext())
{
var total = db.Database.SqlQuery<decimal>("Get_ProposalTotal", null);
return await total.FirstAsync();
}
}
I'm calling it here in the controller:
public async Task<ActionResult> Index(int? page, string search)
{
model.Proposaltotal = Convert.ToDecimal(GetTotalProposalAmount());
return View(model);
}