dualbios / FileBaseContext

FileBaseContext is a provider of Entity Framework 7&8 to store database information in files.
MIT License
28 stars 9 forks source link

DatabaseGenerated(DatabaseGeneratedOption.Identity) is not supported #18

Closed daveidmx closed 10 months ago

daveidmx commented 10 months ago

Adding an entity with a mapped property having [DatabaseGenerated(DatabaseGeneratedOption.Identity)] throws NotSupportedException:

The property 'EntityHasIdentity.Id' does not have a value set and no value generator is available for properties of type 'int'. Either set a value for the property before adding the entity or configure a value generator for properties of type 'int' in 'OnModelCreating'.

I've implemented this and added unit tests in https://github.com/daveidmx/FileBaseContext/commit/5e25c29b0aeb52ac9c478aabb504284e73317f48 and can put up a PR once #17 is resolved.