Freelance Project Requests info@CodeDocu.de Software Development in C# WPF Asp.Net Core Vba Excel Word SQL-Server EF Linq, UWP Net
#

Error CS0815: Cannot assign <null> to an implicitly-typed variable

 

When I'm trying to get into C's Asp.Net Core . Net5 to create a var variable

 

var query=null;

 

Fehlermeldung

 

 

Solution is in the assignment you want

In this case, a hover extends over the . ToListAsync() Text. The info contains the return value List<ArticleModel>

 

 

 

Lösung der Definition

var query = new List<ArticleModel>();

            try

            {

                var data = _context.tbl_Articles.Take(10);

                query = await data.ToListAsync();

            }

            catch (Exception err)

            {

                return BadRequest(err.Message);               

            }

 

Mobile

.

Contact for Jobs, Project Requests: raimund.popp@microsoft-programmierer.de