daxnet/Apworks

Fluent Interface issue.

Closed this issue · 2 comments

WithDefaultSettings configs 2 part of things.

1.IdentityGenerator
2.SequenceGenerator

And the instances for them are "Apworks.Generators.IdentityGenerator" and "Apworks.Generators.SequenceGenerator"

This is NOT correct.

Because when the IdentityGenerator trying to load its instance, an exception will be thrown internally by this line of the codes:

Apworks\Generators\IdentityGenerator.cs

Line 64:

if (type.Equals(this.GetType()))
                    throw new ApworksException("Type {0} cannot be used as identity generator, it is maintained by the Apworks framework internally.", this.GetType().AssemblyQualifiedName);

Change Apworks\Config\Fluent\Extensions.cs

Line 96

return WithIdentityGenerator<IdentityGenerator>(configurator);

To

return WithIdentityGenerator<SequentialIdentityGenerator>(configurator);

shall fix this problem.

Thank you for committing the issue here, and I will investigate the issues and get them fixed.

This issue has been fixed.