|
using System.Web;
using System.ServiceModel.DomainServices.Server;
using LightSwitchApplication.Implementation;
namespace LightSwitchApplication
{
public class LightSwitchDomainService
{
public static ApplicationDataDomainService
GetLightSwitchDomainService(HttpContext objHtpContext, DomainOperationType DOT)
{
// Create a Service Provider
ServiceProvider sp = new ServiceProvider(objHtpContext);
// Create a Domain Context
// Set DomainOperationType (Invoke, Metdata, Query, Submit)
DomainServiceContext csc = new DomainServiceContext(sp, DOT);
// Use the DomainServiceContext to instantiate an instance of the
// LightSwitch ApplicationDataDomainService
ApplicationDataDomainService ds =
DomainService.Factory.CreateDomainService(typeof(ApplicationDataDomainService), csc)
as ApplicationDataDomainService;
return ds;
}
}
}
|
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.