Is it possible to use MVVM Light with Entity Framework Core in a UWP project?

筅森魡賤 提交于 2020-07-10 10:25:06

问题


I'm trying to use Entity Framework Core with UWP. I found this sample from Microsoft and got it to work. In this sample, the object models are in a .Net Standard class library. However, for the project I'm working on, I need to be able to use MVVM Light's RaisePropertyChanged method in the setters of my object models. The issue I'm running into is that MVVM Light is apparently not compatible with .NET Standard 2.0, only 1.0.

MVVM Light does seem to install correctly to the class library, but when I try to add a using statement it doesn't work: using GalaSoft.MvvmLight; gives me a "The type or namespace GalaSoft could not be found." (I did also try without "GalaSoft.")

I've tried everything I can think of, and this really has me stumped. Is there any way that I can use MVVM Light with UWP and Entity Framework Core?


回答1:


.NET Standard versions are always backwards compatible, so MVVM Light being .NET Standard 1.0, it makes it fully compatible with .NET Standard 2.0 libraries. You must use the .NET Standard version of MVVM Light which is here: https://www.nuget.org/packages/MvvmLightLibsStd10/



来源:https://stackoverflow.com/questions/55124254/is-it-possible-to-use-mvvm-light-with-entity-framework-core-in-a-uwp-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!