/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DeleteGroupResponse response = new DeleteGroupResponse(); return(response); }
public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { DeleteGroupResponse response = new DeleteGroupResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.IsStartElement) { if (context.TestExpression("DeleteGroupResult", 2)) { UnmarshallResult(context, response); continue; } if (context.TestExpression("ResponseMetadata", 2)) { response.ResponseMetadata = ResponseMetadataUnmarshaller.Instance.Unmarshall(context); } } } return(response); }
public static DeleteGroupResponse Unmarshall(UnmarshallerContext context) { DeleteGroupResponse deleteGroupResponse = new DeleteGroupResponse(); deleteGroupResponse.HttpResponse = context.HttpResponse; deleteGroupResponse.RequestId = context.StringValue("DeleteGroup.RequestId"); return(deleteGroupResponse); }
public static DeleteGroupResponse Unmarshall(UnmarshallerContext context) { DeleteGroupResponse deleteGroupResponse = new DeleteGroupResponse(); deleteGroupResponse.HttpResponse = context.HttpResponse; deleteGroupResponse.RequestId = context.StringValue("DeleteGroup.RequestId"); deleteGroupResponse.Code = context.IntegerValue("DeleteGroup.Code"); deleteGroupResponse.Message = context.StringValue("DeleteGroup.Message"); deleteGroupResponse.Success = context.BooleanValue("DeleteGroup.Success"); return(deleteGroupResponse); }
public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { DeleteGroupResponse response = new DeleteGroupResponse(); while (context.Read()) { if (context.IsStartElement) { if (context.TestExpression("ResponseMetadata", 2)) { response.ResponseMetadata = ResponseMetadataUnmarshaller.GetInstance().Unmarshall(context); } } } return(response); }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DeleteGroupResponse response = new DeleteGroupResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Group", targetDepth)) { var unmarshaller = GroupUnmarshaller.Instance; response.Group = unmarshaller.Unmarshall(context); continue; } } return(response); }
public DeleteGroupResponse Delete(int id) { var response = new DeleteGroupResponse(); try { var group = new Group { Id = id }; DataContext.Groups.Attach(group); DataContext.Entry(group).State = EntityState.Deleted; DataContext.SaveChanges(); response.IsSuccess = true; response.Message = "Group item has been updated successfully"; } catch (DbUpdateException dbUpdateException) { response.IsSuccess = false; response.Message = dbUpdateException.Message; } return response; }
private static void UnmarshallResult(XmlUnmarshallerContext context, DeleteGroupResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 2; } while (context.ReadAtDepth(originalDepth)) { if (context.IsStartElement || context.IsAttribute) { } } return; }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DeleteGroupResponse response = new DeleteGroupResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("RequestId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.RequestId = unmarshaller.Unmarshall(context); continue; } } response.Status = (int)context.ResponseData.StatusCode; return(response); }
public DeleteGroupResponse Delete(int id) { var response = new DeleteGroupResponse(); try { var group = new Group { Id = id }; DataContext.Groups.Attach(group); DataContext.Entry(group).State = EntityState.Deleted; DataContext.SaveChanges(); response.IsSuccess = true; response.Message = "Group item has been Deleted successfully"; } catch (DbUpdateException dbUpdateException) { response.IsSuccess = false; response.Message = dbUpdateException.Message; } return(response); }
public Task <bool> DeleteGroupByIdAsync(long groupId, CancellationTokenSource cancellationTokenSource) => Task.Run(async() => { if (!CrossConnectivity.Current.IsConnected) { throw new InvalidOperationException(AppConsts.ERROR_INTERNET_CONNECTION); } bool deleteCompletion = false; DeleteGroupRequest deleteGroupRequest = new DeleteGroupRequest() { AccessToken = GlobalSettings.Instance.UserProfile.AccesToken, Url = string.Format(GlobalSettings.Instance.Endpoints.GroupsEndpoints.DeletePostById, groupId) }; try { DeleteGroupResponse deleteGroupResponse = await _requestProvider.PostAsync <DeleteGroupRequest, DeleteGroupResponse>(deleteGroupRequest); if (deleteGroupResponse != null) { deleteCompletion = true; } } catch (ServiceAuthenticationException exc) { _identityUtilService.RefreshToken(); throw exc; } catch (Exception exc) { Crashes.TrackError(exc); throw; } return(deleteCompletion); }, cancellationTokenSource.Token);