Skip to content

Queries: do they have to be defined in a command? #123

Answered by rofr
TheColonel2688 asked this question in Q&A
Discussion options

You must be logged in to vote

I just want something in memory, that behaves the same.

Why mimick the behavior of an object-relational mapper (ORM) when there is no mapping and moving data back and forth between the application and the database?

With an ORM you typically

  1. Read some data from the database and create objects that represent this data
  2. Make changes to the objects
  3. Detect and translate those changes back to the database.

This is actually very complicated and difficult to do correctly. It imposes constraints on you as a developer with contrived code and lots of traps to fall into. In code this looks like:

// Entity Framework example
var ctx = new MyDbContext();
var product = ctx.Products.Include(p => p.Parts).

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
6 replies
@rofr
Comment options

@TheColonel2688
Comment options

@TheColonel2688
Comment options

@TheColonel2688
Comment options

@TheColonel2688
Comment options

Comment options

You must be logged in to vote
1 reply
@TheColonel2688
Comment options

Answer selected by TheColonel2688
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants