Diligence. NET 4.0 (6)

Source: Internet
Author: User
Tags config int size rowcount

Introduced

New features of Ado.net Data Services 1.5

* Support Service-side rowcount-gets the number of members of the specified entity collection (returns only an integer value and does not return an entity collection)

* Support Service-side paging-server side can return paginated data, and it can contain total data totals

* Support for Server Select-returned results only include fields for select

* Support Large data transfer BLOB (binary large object)

* Support Custom Data Services

Example

1, service-side rowcount Demo

MyDataService.svc.cs

Code

using System;
using System.Collections.Generic;
using System.Data.Services;
using System.Data.Services.Common;
using System.Linq;
using System.ServiceModel.Web;
using System.Web;
Namespace DataAccess.DataServices.Service
{
[System.ServiceModel.ServiceBehavior ( Includeexceptiondetailinfaults = True)]
public class Mydataservice:dataservice<myentity.adventureworksentiti              Es>
{
public static void InitializeService (dataserviceconfiguration config)
{
Config. Dataservicebehavior.maxprotocolversion = Dataserviceprotocolversion.v2;
Config. Setentitysetaccessrule ("Products", entitysetrights.all);
//Setentitysetpagesize (string name, int size)-new method.              Used to provide the paging data
//String name-Specify the entity collection to be used for paging
//int Size-page size for pagination
Config. Setentitysetpagesize ("Products", 5);
}
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.