kant2002 / SqlMarshal

Generates data access using stored procedures
Other
58 stars 6 forks source link

Look at nullable annotations when retrieve single row #6

Closed kant2002 closed 2 years ago

kant2002 commented 2 years ago

When generation of code for nullable context, nullability of result type should affects if generated FirstOrDefault or simply First,

consider following definition

[SqlMarshal("sp")]
public partial Totals GetTotals();

produces

public partial Totals GetTotals()
{
...
return this.dbContext.Totals.FromSqlRaw(sqlQuery, parameters).AsEnumerable().FirstOrDefault();
...
}

which trigger nullability warnings