-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
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
Labels
No labels