Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for init config from assembly by typed class configuration #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

zach88
Copy link

@zach88 zach88 commented Apr 28, 2019

when entities are made with code generator, is more easy decor properties with attributes than make a fluent config, so I added a exclude attribute to decor properties.

@zach88 zach88 changed the title Exclude property by attribute and unit test Support for init config from assembly by typed class configuration Jun 17, 2019
@zach88
Copy link
Author

zach88 commented Jun 17, 2019

to decouple the configuration of each entity and avoid adding each entity at init, it is now possible to create configuration files in Entity Framework style, so you only need specify the assembly that you want SimplePatch scan and config for you, base on your config files

Startup

	var assembly = typeof(Person).Assembly;
	DeltaConfig.InitFromAssembly(cfg => {
		cfg.AddAssembly(assembly);
	});

Config file

    public class PersonConfiguration : Mapping.IEntityTypeConfiguration<Person>
    {
        public void Configuration(DeltaConfig.EntityConfig<Person> entityConfig)
        {
            entityConfig.Property(x => x.AgeExcludeByMapping).Exclude();
        }
    }

@zach88
Copy link
Author

zach88 commented Jul 3, 2019

@OmarMuscatello any comments?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant