本文介绍了我如何从后面的代码使用RIA/LINQ的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,我看了几个有关如何使用RIA服务填充数据网格的教程,但我不希望这样.相反,我想到达对象,然后从那里设置一些变量.

像这样的东西:

I have a problem, i have watch several tutorials on how you populate a datagrid with RIA services but i dont want that. Instead i want to reach the object and from there i want to set some variables.

Something like this:

---- CODE BEHIND------
List<dbBook> books = new List<dbBook>
dbBook book = contex.GetDbBookByIDQuery(870);
int id = book.ID;
books.Add(book);

----- DomainService -------
public dbBook GetDbBookByIDQuery(int bookID)
{
   dbBook book;
   book = this.ObjectContext.dbBook(b => b.ID == bookID);
   return book;
}



我敢打赌,这确实很容易,但是我被困住了,这开始变得非常令人沮丧:mad:

感谢所有帮助!



I bet this is really easy but i am stuck and this starts to get really frustrating:mad:

I appreciated all help!!

推荐答案


这篇关于我如何从后面的代码使用RIA/LINQ的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 02:19