ploeh,

New article: Do ORMs reduce the need for mapping? https://blog.ploeh.dk/2023/09/18/do-orms-reduce-the-need-for-mapping

khalidabuhakmeh,
@khalidabuhakmeh@mastodon.social avatar

@ploeh EF Core doesn't have the limitation you mentioned. You can nest objects and serialize them to a column using JSON serialization.

ploeh,

@khalidabuhakmeh I'm trying to read from the database into my Domain Model. How do I do that?

Feel free to add an answer to https://stackoverflow.com/q/77039584/126014 if this is actually possible.

khalidabuhakmeh,
@khalidabuhakmeh@mastodon.social avatar

@ploeh I'm on vacation right now but I'll give it a shot when I get back.

EF Core 8 is adding mapping to untracked entities.

Update: here's the confirmation. https://github.com/dotnet/efcore/issues/10753

flensrocker,

@khalidabuhakmeh @ploeh Just for your information: You can nest objects into Entity-types, they are called "Owned Entity Types" [1]. But that has nothing to do with your mapping to your domain model. I haven't tried it with your code.
And yes, scaffolding is not perfect, I use the "EF Core Power Tools" [2] by Erik EJ for such things.

[1] https://learn.microsoft.com/en-us/ef/core/modeling/owned-entities
[2] https://github.com/ErikEJ/EFCorePowerTools

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • DreamBathrooms
  • InstantRegret
  • osvaldo12
  • magazineikmin
  • tacticalgear
  • rosin
  • everett
  • Youngstown
  • ngwrru68w68
  • slotface
  • tester
  • kavyap
  • Durango
  • thenastyranch
  • JUstTest
  • mdbf
  • GTA5RPClips
  • cubers
  • cisconetworking
  • khanakhh
  • Leos
  • provamag3
  • ethstaker
  • modclub
  • anitta
  • megavids
  • normalnudes
  • lostlight
  • All magazines