如何将ObservableCollection与Entity Framework 6一起使用?

编程入门 行业动态 更新时间:2024-10-27 16:24:45
本文介绍了如何将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一起使用?

本文发布于:2023-11-14 16:20:38,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1587936.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何将   ObservableCollection   Framework   Entity

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!