locked
SingleOrDefaultAsync + Result Vs SingleOrDefault RRS feed

  • Question

  • User-540818677 posted

    Inside my asp.net core MVC 3.1; Is there any differences between using using SingleOrDefaultAsync + Result, as follow:-

    var result = _context.Settings.SingleOrDefaultAsync(a => a.Name.ToLower() == "noofvisits").Result.Value;

    and only using SingleOrDefault ??, as follow:-

    var result = _context.Settings.SingleOrDefault(a => a.Name.ToLower() == "noofvisits").Value;
    Monday, June 29, 2020 5:28 PM

All replies