How to fix Error CS0029 Cannot implicitly convert type 'void' to 'System.Collections.Generic.List<Vase.Models.Person>'

Gbenga Banuso Odumosu 40 Reputation points
2024-05-07T00:20:57.27+00:00
var user = from u in conn.Table<Person>()

querywhere u.name  == "WALE"


       select u;

return user.FirstOrDefaultAsync().Wait();

I got error in the bold line. i cant figure what i did wrong pleas help

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,959 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,354 questions
Entity Framework Core Training
Entity Framework Core Training
Entity Framework Core: A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.Training: Instruction to develop new skills.
3 questions
0 comments No comments
{count} votes

Accepted answer
  1. 2024-05-07T03:54:27.85+00:00

    Wait() returns void. Switch to:

    return await user.FirstOrDefaultAsync();
    

    Let me know if you need additional or more detailed guidance. If the answer was helpful, please accept it and rate it so that others facing a similar issue can easily find a solution.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful