Video on Hosting WCF Data Service in Console Application

MyDataService.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ServiceModel; using System.ServiceModel.Web; using System.Data.Services; using System.Data.Services.Common; namespace DemoHostingInConsole { public class MyDataService : DataService<StudentDBEntities> { public static void InitializeService(DataServiceConfiguration config) { config.SetEntitySetAccessRule(“*”, EntitySetRights.All); config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2; } } } Program.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ServiceModel; using System.ServiceModel.Web; using System.Data.Services; […]

Video tutorial on Hosting WCF Service with netTcpBinding in Windows Service

WCF Service IService1.cs using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.ServiceModel; using System.Text; namespace NetTcpServicetoHostinWindowsServices { [ServiceContract] public interface IService1 { [OperationContract] string GetData(int value); } } Service1.svc.cs using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.ServiceModel; using System.Text; namespace NetTcpServicetoHostinWindowsServices { public class Service1 : IService1 { public string GetData(int value) […]

Video tutorial on Consuming WCF Data Service

Source code using System; using System.Collections.Generic; using System.Linq; using System.Text; using secondClient.ServiceReference1; using System.Data.Services.Client; namespace secondClient { class Program { static void Main(string[] args) { DataServiceContext context = new DataServiceContext (new Uri(“http://localhost:3803/WcfDataService1.svc/&#8221;)); StudentDBEntities studentDbEnt = new StudentDBEntities (new Uri(“http://localhost:3803/WcfDataService1.svc/&#8221;)); #region Get all the Records var res = from r in studentDbEnt.Students select r; foreach (var […]