- FrictSLUnitTest.zip
- README.txt
- Sample.Silverlight.WCF.sln
- Source
- Sample.Silverlight.WCF.Tests.Clumsy.Web
- Sample.Silverlight.WCF.Tests.Clumsy
- Sample.Silverlight.WCF.Tests
- Sample.Silverlight.WCF.Web
- Sample.Silverlight.WCF
- Tools
- NUnit
- nunit.framework.dll
- nunit.silverlight.dll
- Rhino.Mocks
- Castle.Core-Silverlight.dll
- Castle.DynamicProxy-Silverlight.dll
- Rhino.Mocks 3.5.Silverlight.dll
|
#region Author
//// Yevhen Bobrov, http://blog.xtalion.com
#endregion
using System;
using System.Linq.Expressions;
using System.ServiceModel;
namespace Sample.Silverlight.WCF.Infrastructure.Services
{
public class ServiceCallBuilder<TService> where TService : class
{
readonly TService instance;
readonly ServiceChannelFactory<TService> factory;
public ServiceCallBuilder(string address)
: this(null, address)
{}
public ServiceCallBuilder(TService instance, string address)
{
this.instance = instance;
factory = new ServiceChannelFactory<TService>(new EndpointAddress(address));
}
public ServiceCommand<TService> Command(Expression<Action<TService>> call)
{
return new ServiceCommand<TService>(factory, instance, call);
}
public ServiceQuery<TResponse, TService> Query<TResponse>(Expression<Func<TService, TResponse>> call)
{
return new ServiceQuery<TResponse, TService>(factory, instance, call);
}
}
}
|
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.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.