渴望和懒惰加载

编程入门 行业动态 更新时间:2024-10-28 16:29:08
本文介绍了渴望和懒惰加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好,

我有表A女巫与许多表格有关系,比如B,C,D

Hi all,

I have table A witch have relation to many tables , say B,C,D

在EF映射中我得到对象A与类型B,C,D的集合

in the EF mapping I get Object A with Collection of types B,C,D incide.

当我尝试从客户端插入新对象A时,我应该在之前提供对象B,C,D并使用SetLink命令。

When I'm trying to insert a new object A from the client side , I should supply objects B,C,D before and use the SetLink command.

我的问题,我必须从服务器对象B,C,D中取出由于某些creteria和保存A。

My problem , I have to fetch from the server objects B,C,D due to some creteria and the save A.

但这似乎非常昂贵每次去许多旅行到服务器,直到我可以保存对象A.

But this seems very expensive each time to make many travels to the server till I can save object A.

我的代码是这样的:

AB = client.B.Where(id => id.b_id == 1)。 ();与C和D相同的事情

A.B = client.B.Where(id=>id.b_id == 1).First(); the same thing to C and D

client.SetLink(A," B",AB);

client.SetLink(A,"B",A.B);

client.SaveChanges();

client.SaveChanges();

任何建议将此往返保存到服务器。

Any suggestion to save this roundtrips to the server.

谢谢......

推荐答案

不,不,我们不会告诉你答案,你必须付钱对于这种支持 No no we dont telll you the answer, you have to pay for this kind of support

更多推荐

渴望和懒惰加载

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

发布评论

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

>www.elefans.com

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