在UWP项目中是否可以将MVVM Light与Entity Framework Core一起使用? [英] Is it possible to use MVVM Light with Entity Framework Core in a UWP project?

查看:226
本文介绍了在UWP项目中是否可以将MVVM Light与Entity Framework Core一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Entity Framework Core与UWP一起使用.我从Microsoft找到了这个示例并使其起作用.在此示例中,对象模型位于.Net Standard类库中.但是,对于我正在处理的项目,我需要能够在对象模型的设置器中使用MVVM Light的RaisePropertyChanged方法.我遇到的问题是MVVM Light显然与.NET Standard 2.0仅兼容1.0.

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似乎可以正确安装到类库中, 但是当我尝试添加using语句时,它不起作用:using GalaSoft.MvvmLight;给我一个找不到类型或名称空间GalaSoft的信息." (我也尝试过不使用"GalaSoft".)

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.")

我已经尝试了所有我能想到的,这确实让我感到困惑.有什么方法可以将MVVM Light与UWP和Entity Framework Core一起使用?

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?

推荐答案

.NET Standard版本始终向后兼容,因此MVVM Light是.NET Standard 1.0,使其与.NET Standard 2.0库完全兼容.您必须在以下位置使用MVVM Light的.NET标准版本: https://www.nuget.org/packages/MvvmLightLibsStd10/

.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/

这篇关于在UWP项目中是否可以将MVVM Light与Entity Framework Core一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆