Click here to Skip to main content
15,885,757 members
Articles / Programming Languages / XML

Efficiently exposing your data with minimal effort

Rate me:
Please Sign up or sign in to vote.
4.88/5 (19 votes)
16 Nov 2009CPOL14 min read 49.8K   386   30  
An article on how we can expose our data efficiently with minimal effort by leveraging Microsoft ADO.NET Data Services.
//////////////////////////////////////////////////
// Author : Gnana
// Contact Details : vgnanasekaran@gmail.com
// Description : Codebehind class of the ADO.NET Data Service exposing employee entity
///////////////////////////////////////////////////




using System;
using System.Collections.Generic;
using System.Data.Services;
using System.Linq;
using System.ServiceModel.Web;
using System.Web;

namespace DataServicesDemo
{
    public class EmployeeDataService : DataService<EmployeeEntity>
    {
        // This method is called only once to initialize service-wide policies.
        public static void InitializeService(IDataServiceConfiguration config)
        {
            // TODO: set rules to indicate which entity sets and service operations are visible, updatable, etc.
            // Examples:
            config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);
            config.SetServiceOperationAccessRule("*", ServiceOperationRights.All);
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect Collabera
India India
Gnana (Gnanasekaran) is currently working as a Senior Architect at Collabera, Bangalore, India, having more than 10 years experience. His area of specialization includes SOA, BPM, Messaging, Integration and Enterprise Architecture. The emerging tech. trends like web 2.0 and Enterprise Mobility excites him a lot. Architectural consulting is his core expertise. He also possess experience in Data warehousing and business intelligence solutions consulting, based on the Microsoft technology stack like SSAS, SSIS and SQL Server. You can reach him via e-mails at gnana.sekaran@collabera.com & vgnanasekaran@yahoo.com or at www.gnanasekaran.com

Comments and Discussions