emrekizildas / EntityFrameworkCore.EncryptColumn.Example

Example for using EntityFrameworkCore.EncryptColumn package.
14 stars 2 forks source link

How to integrate with entity framework migrations #2

Closed caboodal closed 10 months ago

caboodal commented 10 months ago

I have added the EncryptColumn package to my project and have discovered that the call to modelBuilder.UseEncryption causes the following error to be raised: -

Unable to create a 'DbContext' of type ''. The exception 'Method not found: 'System.Collections.Generic.IEnumerable`1<Microsoft.EntityFrameworkCore.Metadata.IMutableProperty> Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType.GetProperties()'.' was thrown while attempting to create an instance. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728

I'm trying to avoid using a factory method to create the database context, is it possible to somehow conditionally call the UseEncryption extension method?

caboodal commented 10 months ago

Actually ignore that I've just realised that I have no encryption key coming through so it's probably that!