Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix compile errors from adding Silverlight client support

  • Loading branch information...
commit e8c8e9f9420eb70777c1f4b8c14dc07bfcd52ba0 1 parent fb3df9c
@mythz mythz authored
View
4 src/ServiceStack.Common/ServiceModel/Serialization/JsonDataContractDeserializer.cs
@@ -63,7 +63,7 @@ public T DeserializeFromStream<T>(Stream stream)
#if !SILVERLIGHT && !MONOTOUCH && !XBOX
if (UseBcl)
{
- var serializer = new DataContractJsonSerializer(typeof(T));
+ var serializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(typeof(T));
return (T)serializer.ReadObject(stream);
}
#endif
@@ -78,7 +78,7 @@ public object DeserializeFromStream(Type type, Stream stream)
#if !SILVERLIGHT && !MONOTOUCH && !XBOX
if (UseBcl)
{
- var serializer = new DataContractJsonSerializer(type);
+ var serializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(type);
return serializer.ReadObject(stream);
}
#endif
View
7 src/ServiceStack.ServiceInterface/Auth/AuthService.cs
@@ -67,6 +67,13 @@ static AuthService()
CurrentSessionFactory = () => new AuthUserSession();
}
+ public AuthService() {}
+
+ public AuthService(IAppHost appHost) : this()
+ {
+ SetAppHost(appHost);
+ }
+
public static IAuthProvider GetAuthProvider(string provider)
{
if (AuthProviders == null || AuthProviders.Length == 0) return null;
View
2  src/ServiceStack.ServiceInterface/IServiceBase.cs
@@ -5,7 +5,7 @@ namespace ServiceStack.ServiceInterface
{
public interface IServiceBase : IResolver
{
- IAppHost AppHost { get; set; }
+ IAppHost GetAppHost();
/// <summary>
/// Resolve an alternate Web Service from ServiceStack's IOC container.
View
30 src/ServiceStack.ServiceInterface/ServiceBase.cs
@@ -49,18 +49,18 @@ public virtual string ServiceName
/// <summary>
/// Access to the Applications ServiceStack AppHost Instance
/// </summary>
- private IAppHost appHost;
- public virtual IAppHost AppHost
- {
- get
- {
- return appHost ?? EndpointHost.AppHost;
- }
- set
- {
- this.appHost = value;
- }
- }
+ ///
+ private IAppHost appHost; //not property to stop alt IOC's creating new instances of AppHost
+
+ public IAppHost GetAppHost()
+ {
+ return appHost ?? EndpointHost.AppHost;
+ }
+
+ public void SetAppHost(IAppHost appHost)
+ {
+ this.appHost = appHost;
+ }
public IRequestContext RequestContext { get; set; }
@@ -108,7 +108,7 @@ public ISession Session
/// <returns></returns>
public T ResolveService<T>()
{
- var service = this.AppHost.TryResolve<T>();
+ var service = this.GetAppHost().TryResolve<T>();
var requiresContext = service as IRequiresRequestContext;
if (requiresContext != null)
{
@@ -143,9 +143,9 @@ public virtual string GetRequestErrorBody()
public T TryResolve<T>()
{
- return this.AppHost == null
+ return this.GetAppHost() == null
? default(T)
- : this.AppHost.TryResolve<T>();
+ : this.GetAppHost().TryResolve<T>();
}
/// <summary>
View
2  src/ServiceStack/Properties/AssemblyInfo.cs
@@ -33,5 +33,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("3.3.9.*")]
+[assembly: AssemblyVersion("3.4.0.*")]
//[assembly: AssemblyFileVersion("1.0.*")]
View
5 tests/ServiceStack.Common.Tests/OAuth/OAuthUserSessionTestsBase.cs
@@ -168,18 +168,17 @@ protected void InitTest(IUserAuthRepository userAuthRepository)
requestContext.Container.Register(userAuthRepository);
- mockAppHost.Register(new AuthService {
- AppHost = mockAppHost,
+ mockAppHost.Register(new AuthService(mockAppHost) {
RequestContext = requestContext,
});
var registrationService = new RegistrationService {
- AppHost = mockAppHost,
UserAuthRepo = userAuthRepository,
RequestContext = requestContext,
RegistrationValidator =
new RegistrationValidator { UserAuthRepo = RegistrationServiceTests.GetStubRepo() },
};
+ registrationService.SetAppHost(mockAppHost);
return registrationService;
}
Please sign in to comment.
Something went wrong with that request. Please try again.