I'm trying to pick 1 record from a table but the error i keep getting is
'IEnumerable' does not contain a definition for 'GetAwaiter' and no extension method 'GetAwaiter' accepting a first argument of type 'IEnumerable' could be found (are you missing a using directive or an assembly reference?)
public class IntermediaryAssignment
{
public string Company{get;set:}
public string RegistrationNumber{get;set:}
public bool Dispatched{get;set:}
}
public async Task<IntermediaryAssignment> PickOneSticker(string company,
string registrationNumber)
{
var db = new DatabaseContext();
var results = await (from s in db.IntermediaryAssignment
where s.Dispatched == false && s.CompanyCode ==
company && s.RegistrationNumber ==
registrationNumber orderby s.StickerCode
ascending select s).ToList().Take(1);
return results.FirstOrDefault();
}