by Corrado Cavalli via Corrado's BLogs on 1/31/2011 6:47:51 AM
If you do serious WCF RIA Services development you’ll probably end up with something like this:
using System.Linq;using System.ServiceModel.DomainServices.Hosting;using System.ServiceModel.DomainServices.Server;[EnableClientAccess()]public class NorthwindService : DomainService{ private readonly NorthwindEntities datacontext = new NorthwindEntities(); [Query] public IQueryable<Customers> GetCustomers() { return this.datacontext.Customers; }}
dataGrid1.ItemsSource = this.context.Customers;EntityQuery<Customers> query = this.context.GetCustomersQuery();query = query.Skip(page).Take(size);this.context.Load(query, lop => { int tot = lop.TotalEntityCount; }, null);
EntityQuery<Customers> query = this.context.GetCustomersQuery();query = query.Skip(2).Take(3);query.IncludeTotalCount = true;
[EnableClientAccess()]public class NorthwindService : DomainService{ private readonly NorthwindEntities datacontext = new NorthwindEntities(); protected override int Count<T>(IQueryable<T> query) { return query.Count(); } [Query] public IQueryable<Customers> GetCustomers() { return this.datacontext.Customers; }}
Original Post: WCF RIA Services and TotalEntitiesCount=-1
The content of the postings is owned by the respective author. Silverlight Feeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on Silverlight Feeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.