public ModifyResult UpdateOAuthUserAuthorization(Stream input, int id) { /*StreamReader reader = new StreamReader(input); * String content = reader.ReadToEnd();*/ XmlSerializer xmlSerializer = new XmlSerializer(typeof(OAuthAuthorization)); OAuthAuthorization auth = (OAuthAuthorization)xmlSerializer.Deserialize(input); // Create the mapper Arena.Custom.HDC.WebService.Contracts.OAuthAuthorizationMapper mapper = new Arena.Custom.HDC.WebService.Contracts.OAuthAuthorizationMapper(); if (auth.AuthorizationId > 0) { return(mapper.Update(auth)); } else { return(mapper.Create(auth)); } }
public ModifyResult UpdateOAuthUserAuthorization(String clientApiKey, OAuthAuthorization auth) { Arena.Custom.SECC.OAuth.Client client = new Arena.Custom.SECC.OAuth.Client(new Guid(clientApiKey)); if (auth.ClientId != client.ClientId) { throw new ResourceNotFoundException("Client API Key mismatch."); } // Create the mapper Arena.Custom.HDC.WebService.Contracts.OAuthAuthorizationMapper mapper = new Arena.Custom.HDC.WebService.Contracts.OAuthAuthorizationMapper(); if (auth.AuthorizationId > 0) { return(mapper.Update(auth)); } else { return(mapper.Create(auth)); } }
public ModifyResult UpdateOAuthUserAuthorization(String clientApiKey, OAuthAuthorization auth) { Arena.Custom.SECC.OAuth.Client client = new Arena.Custom.SECC.OAuth.Client(new Guid(clientApiKey)); if (auth.ClientId != client.ClientId) { throw new ResourceNotFoundException("Client API Key mismatch."); } // Create the mapper Arena.Custom.HDC.WebService.Contracts.OAuthAuthorizationMapper mapper = new Arena.Custom.HDC.WebService.Contracts.OAuthAuthorizationMapper(); if (auth.AuthorizationId > 0) { return mapper.Update(auth); } else { return mapper.Create(auth); } }
public ModifyResult UpdateOAuthUserAuthorization(Stream input, int id) { /*StreamReader reader = new StreamReader(input); String content = reader.ReadToEnd();*/ XmlSerializer xmlSerializer = new XmlSerializer(typeof(OAuthAuthorization)); OAuthAuthorization auth = (OAuthAuthorization)xmlSerializer.Deserialize(input); // Create the mapper Arena.Custom.HDC.WebService.Contracts.OAuthAuthorizationMapper mapper = new Arena.Custom.HDC.WebService.Contracts.OAuthAuthorizationMapper(); if (auth.AuthorizationId > 0) { return mapper.Update(auth); } else { return mapper.Create(auth); } }