Closed mrlnnl closed 4 years ago
In general, you're going to have a bad time if you try and use the same classes both as ViewModels and as EF models.
If your VMs are very simple, you can get away with binding directly to EF models (although you won't get INPC, of course). Anything more complex, and you're best off defining separate ViewModels and EF models, and mapping between them.
Hello, thanks for your response. After months of working with ef core, you are definitely right in defining separate classes. ;)
I'm trying to build a netcore app using stylet, propertychanged.fody & entity framework core. While adding PropertyChangedBase as a base class on a model i get the following error:
Exception thrown: 'System.InvalidOperationException' in Microsoft.EntityFrameworkCore.dll An exception of type 'System.InvalidOperationException' occurred in Microsoft.EntityFrameworkCore.dll but was not handled in user code No suitable constructor found for entity type 'Action<Action>'. The following constructors had parameters that could not be bound to properties of the entity type: cannot bind 'object', 'method' in 'Action<Action>(object object, IntPtr method)'.