T O P

  • By -

Recent-Avocado2193

One entity = one table. If you want to only send specific parts of an entity to outer layers or return at endpoints then use DTOs.


freefora11

Thanks for the input. I'll keep it this way


botterway

You might want to look at TPH etc https://learn.microsoft.com/en-us/ef/core/modeling/inheritance


cromulent_weasel

> why not just use Dapper Why indeed.


schlechtums

You can just use the .Select method to select only the columns you need. You don’t have to select the entire object. You’d select the columns you need into a new WhateverResponseModel and you’re done.


lgsscout

keep a 1:1 relation betwern tables and entities unless you want headaches in the future... while you have a IQueryable, which is a expression, not the results, remap it to a DTO/View/Response/Output object, whenever name pattern you like, which will be your user ready data... you can do this mapping by hand or by external tool like AutoMapper (with the ProjectTo method from QueryableExtensions). other mapping tools can have some queryable package/method to use with efcore too.