开发者

Can EF Code First populate entities from a dataset?

开发者 https://www.devze.com 2023-02-28 05:35 出处:网络
I have the ability to query a legacy system that returns a .NET DataSet. Is there a way to use the Entity Framework Code First to populate my C# entities directly from a DataSet inst开发者_StackOverf

I have the ability to query a legacy system that returns a .NET DataSet.

Is there a way to use the Entity Framework Code First to populate my C# entities directly from a DataSet inst开发者_StackOverflow中文版ead of SQL Server?


You could of course copy the records yourself, but that would still leave the issues of tracking and updating.

So I would say No. Unless somebody develops an EF Provider (IQueryable) for Datasets. And that would be a lot of work, including running (E)SQL on datasets.


You could just instantiate the entities (manually, with Automapper, whatever) and then Attach them to the DbSet.

0

精彩评论

暂无评论...
验证码 换一张
取 消