通用清单EntitySet的转换 [英] Generic List to EntitySet Conversion

查看:177
本文介绍了通用清单EntitySet的转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何转换一个 System.Collections.Generic.List< T> System.Data.Linq.EntitySet< T>

推荐答案

不要以为你可以转换列表< T> 的EntitySet< T> ,但你可以把你的EntitySet的列表的内容

Don't think you can convert a List<T> to an EntitySet<T> but you can put the content of your list in the entitySet.

var list = new List<string> { "a", "b", "c" };
var entitySet = new EntitySet<string>();
entitySet.AddRange(list);

这篇关于通用清单EntitySet的转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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