C
C#•5mo ago
🙈

can some xpalin why in Linq

In linquo querys i need to. use the word Select(p => new) what dose new mean i dont want to create anything but rather retrive data
5 Replies
Jimmacle
Jimmacle•5mo ago
new is a keyword used to instantiate an object in C#
Angius
Angius•5mo ago
new means you instantiate a new object
Jimmacle
Jimmacle•5mo ago
if you're projecting data, then you do in fact want to create something that something being the object you're projecting your data into
Anu6is
Anu6is•5mo ago
What do you mean by retrieve? Select is for transformations... Maybe explain what you actually want to accomplish
Jimmacle
Jimmacle•5mo ago
based on previous threads this is probably an EF Core query projecting the results to some model (LINQ is not just for EF Core, fwiw)