Skip to content

Generating of embedded properties does not support custom conventions #4

@wilbit

Description

@wilbit

For example, I have the next convention:

public sealed class IdKeyConvention : ITypePropertyConvention
{
    public void SpecifyRequirements(ITypeMemberConventionRequirements requirements)
    {
        requirements.Name(x => x == "Id");
        requirements.Type(x => x == typeof(int));
    }

    public void Apply(ITypePropertyConventionContext context)
    {
        context.SetSource<IdKeyDataSource>();
    }
}

and the factory

var factory = AutoPocoContainer.Configure(x =>
{
    x.Conventions(c =>
    {
        c.UseDefaultConventions();
        c.ScanAssembly(typeof(FactoryContainer).Assembly);
    });
    x.AddFromAssemblyContainingType<Customer>();

    //x.Include<...>()...
});

It allows me to don't think about key and store generated entities to a test DB. But it does not work for entities on the second level of properties for example, and I have to expose them explicitly =(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions