Skip to content

Proof of concept trying to evaluate queries with non-primitive types server-side

Notifications You must be signed in to change notification settings

Lobosque/ef-value-object-poc

Repository files navigation

Value Objects (as in DDD) and Ef Core

You can improve your Domain layer using Value Objects instead primitive types to represent data with constraints and other stuff, more about the topic here..

The Value Object implementation was taken from this excellent blog post.

This PoC creates a Social Security Number object and successfully configures EF Core to understand that this should be mapped to a string column in database. It is also able to query objects and deserialize data correctly into the Entities Classes.

However, how one would do very simple query contitions such as LIKE?

This PoC tries to achieve it by implementing the Contains method in the Ssn class, but it doesn't work.

Is there a specific way to instruct EF Core how to evaluate non-primitive types?

Any other suggestions on how this could be achieved? Please feel free to submit PR's or open issues to discuss

About

Proof of concept trying to evaluate queries with non-primitive types server-side

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages