Can I use linq in sharepoint online Provider Hosted Apps on office 365 select and join lists?
1 Answer
You can use Client object model in Sharpoint Online to retrieve.
When you use the CSOM, you can write LINQ queries against client-side objects, such as lists and Webs, and then use the ClientContext class to submit these queries to the server. It's important to understand that when you take this approach, you are using LINQ to Objects to query SharePoint objects, not LINQ to SharePoint. This means that your LINQ expressions are not converted to CAML and you will not see the performance benefits that are associated with CAML conversion.
The LINQ to SharePoint provider is not supported by any of the client-side data access mechanisms.
private IEnumerable<List> newLists;
var dt = new DateTime(2010, 3, 20);
var query = from list
in clientContext.Web.Lists
where list.Created > dt && list.Hidden == false
select list;
newLists = clientContext.LoadQuery(query);
clientContext.ExecuteQueryAsync(onPartQuerySucceeded, onPartQueryFailed);
-
-
it is used in on premise version and server object model. For sharepoint online you can only use client object model.– AanchalJun 15, 2014 at 14:04