Skip to content

Conversation

@JohnCampionJr
Copy link
Contributor

@JohnCampionJr JohnCampionJr commented Oct 8, 2020

Wanted to get your thoughts on this idea. It's a step towards #136 but I didn't like the idea of cluttering up DbSet or Context.

Plus, the definition seems to be created as late as possible (which makes sense), so trying to shoehorn some sort of OnModelCreating into the Context would deeply couple the Context and the Mapping.

This idea of a MappingAdapter would allow an entity to override all definitions at the point of creation without attributes (except of course for this one at the entity level). No dependency on Context or DbSet. Really, the adapter isn't even coupled to the class its adapting.

The processor for this runs last, so the adapter can override whatever it needs to.

This solves my immediate need of changing the entity definition without attributes.

As always, open to naming suggestions :)

@Turnerj Turnerj merged commit 14b2d58 into TurnerSoftware:master Oct 9, 2020
@Turnerj
Copy link
Member

Turnerj commented Oct 9, 2020

This is a good idea, implemented well. Thanks for contributing it!

@Turnerj Turnerj added the enhancement Enhancements & features label Oct 9, 2020
@JohnCampionJr JohnCampionJr deleted the code-config branch October 9, 2020 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhancements & features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants