I have a User
entity with FirstName
and LastName
because this is how a name is stored in the database, but I would like to return a DTO with the Full Name, that will be a computed property using both properties.
Currently, I'm doing it with this:
from u in myContext.Users
select new { FullName = $"{u.FirstName} {u.LastName}" };
Does this code make big impact in the database, since the
FullName
property is calculated?Would it be better to have a calculated
FullName
property in myUser
entity? I would like to do it, but I don't know the disadvantages that could this have. For example, filtering using the computed property.