DomainContext加载(DomainContext Load)
我尝试通过domainservice(async)在代码行中加载一个实体,如:
context.Load<Book>( context.Books.Where(b => b.BookID == 1), (s, e) => { _book = e.Results; }, null);
但我得到以下错误:类型'SilverlightApplication1.Book'不能在泛型类型或方法'System.ServiceModel.DomainServices.Client.DomainContext.Load(System.ServiceModel.DomainServices.Client.EntityQuery)中用作类型参数'TEntity'。 ,System.Action>,object)'。 没有从'SilverlightApplication1.Book'到'System.ServiceModel.DomainServices.Client.Entit的隐式引用转换
怎么解决?
I tried to load a entity by domainservice(async) in on line of code like:
context.Load<Book>( context.Books.Where(b => b.BookID == 1), (s, e) => { _book = e.Results; }, null);
But I got following error: The type 'SilverlightApplication1.Book' cannot be used as type parameter 'TEntity' in the generic type or method 'System.ServiceModel.DomainServices.Client.DomainContext.Load(System.ServiceModel.DomainServices.Client.EntityQuery, System.Action>, object)'. There is no implicit reference conversion from 'SilverlightApplication1.Book' to 'System.ServiceModel.DomainServices.Client.Entit
how to fix it?
原文:https://stackoverflow.com/questions/3644485
满意答案
几件事:
- 休息并不意味着你的想法。 你应该使用return来保留这个功能
- 您可能想要在调用相邻单元格的函数之前检查您是否位于域的边界(否则,它将崩溃)
- 使用递归填充洪水是很好的...仅用于教育目的。 使用队列效率更高
- 一个简单的事情就是尝试一下,看它是否有效!
Several things:
- break does not mean what you think it does. You should use return to leave the function
- You may want to check whether you are at the boundary of your domain before calling the function for the adjacent cells (otherwise, it will crash)
- using a recursion for a flood fill is great... for educational purpose only. Using a queue is much more efficient
- a simple thing is to try it out and see whether it works !
相关问答
更多洪水填充算法(Flood fill algorithm)
洪水填充算法计算房间(Flood Fill Algorithm that counts rooms)
三维阵列上的三维洪水填充算法(Java)(3D Flood Fill Algorithm on a 3D Array (Java))
为什么使用Flood Fill算法时会出现java.lang.StackOverflowError?(Why do I get java.lang.StackOverflowError when using Flood Fill algorithm?)
图像泛光填充后的不同颜色(Different color after image flood fill)
三维表面重建算法(3D surface Reconstruction algorithm)
填充Numpy阵列第三维的清洁方法(Clean Way to Fill Third Dimension of Numpy Array)
MySQL 3D“洪水填充”实施(MySQL 3D “Flood Fill” Implementation)
相关文章
更多form load 的问题
Unable to load configuration.
EXT4 Store Load For Gird Exception
解决Eclipse无法打开“Failed to load the JNI shared library”
Hadoop Could not load native gpl library异常解决
hibernate 多表 join 查询发现还是会重新load one-to-many 子表
hibernate延迟加载
tomcat6启动异常 Could not load com.mysql.jdbc.SQLError的解决方法
tomcat6 启动加载项目时报内存溢出 急
类加载方法
最新问答
更多sp_updatestats是否导致SQL Server 2005中无法访问表?(Does sp_updatestats cause tables to be inaccessible in SQL Server 2005?)
如何创建一个可以与持续运行的服务交互的CLI,类似于MySQL的shell?(How to create a CLI that can interact with a continuously running service, similar to MySQL's shell?)
AESGCM解密失败的MAC(AESGCM decryption failing with MAC)
Zurb Foundation 4 - 嵌套网格对齐问题(Zurb Foundation 4 - Nested grid alignment issues)
湖北京山哪里有修平板计算机的
SimplePie问题(SimplePie Problem)
在不同的任务中,我们可以同时使用多少“上下文”?(How many 'context' we can use at a time simultaneously in different tasks?)
HTML / Javascript:从子目录启用文件夹访问(HTML/Javascript: Enabling folder access from a subdirectory)
为什么我会收到链接错误?(Why do I get a linker error?)
如何正确定义析构函数(How to properly define destructor)
Copyright ©2023 peixunduo.com All Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!