如何将ObservableCollection与Entity Framework 6一起使用? [英] How to use ObservableCollection with Entity Framework 6?

查看:69
本文介绍了如何将ObservableCollection与Entity Framework 6一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用WPF实体框架6。我设计了一个存储库层,它返回IEnumerable< T>到应用程序的ViewModel层。现在,我需要将这些IEnumerable类转换为ObservableCollection,而不会丢失实体框架的更改
跟踪功能。任何人都可以为我提供有关此问题的任何帮助吗?

I am using Entity Framework 6 with WPF. I have designed a repository layer which returns IEnumerable<T> to the ViewModel layer of the application. Now, I need to convert these IEnumerable classes to ObservableCollection without losing the change tracking feature of Entity framework. Can anyone provide me with any help regarding this problem?

推荐答案

我相信我对如何使用ObservableCollection有一个坚定的理解,但我不知道为什么我会使用/更改实体框架。但是你的问题是IEnumberable,我学到的是
数组中列出的对象的属性属性。 (如果我错了,请纠正我。)你是否在问如何创建一个ObservableCollection?如果是的话,你会将它绑定到一个控件吗?


I believe I have a firm understanding of how to use an ObservableCollection, but I have no Idea why I would use/change an Entity Framework. But your question is about IEnumberable, which I've learned is an object's property attributes listed within an array. (Please correct me if I'm wrong.) Are you asking how you can create an ObservableCollection? And if yes, would you be binding it to a control?


这篇关于如何将ObservableCollection与Entity Framework 6一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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