public virtual async Task <ViewModelQueryResult <TViewModel> > PartiallyUpdate(TId id, JsonPatchDocument jsonPatchDocument) { var ofmQueryResult = await ApiModelRepository.Patch(id, jsonPatchDocument); var workoutViewModelQueryResult = new ViewModelQueryResult <TViewModel>(); workoutViewModelQueryResult.HttpStatusCode = ofmQueryResult.HttpStatusCode; if ((int)ofmQueryResult.HttpStatusCode == 200) { workoutViewModelQueryResult.ViewModel = Mapper.Map <TViewModel>(ofmQueryResult.OfmForGet); } else { workoutViewModelQueryResult.ErrorMessagesPresented = ofmQueryResult.ErrorMessagesPresented; } return(workoutViewModelQueryResult); }
public virtual async Task <ViewModelQueryResult <TViewModel> > GetById(TId id, TOfmResourceParameters resourceParameters) { var ofmQueryResult = await ApiModelRepository.GetSingle(id, resourceParameters); var workoutViewModelQueryResult = new ViewModelQueryResult <TViewModel>(); workoutViewModelQueryResult.HttpStatusCode = ofmQueryResult.HttpStatusCode; if ((int)ofmQueryResult.HttpStatusCode == 200) { workoutViewModelQueryResult.ViewModel = Mapper.Map <TViewModel>(ofmQueryResult.OfmForGet); } else { workoutViewModelQueryResult.ErrorMessagesPresented = ofmQueryResult.ErrorMessagesPresented; } return(workoutViewModelQueryResult); }
public virtual async Task <ViewModelQueryResult <TViewModel> > Delete(TId id) { var ofmQueryResult = await ApiModelRepository.Delete(id); var workoutViewModelQueryResult = new ViewModelQueryResult <TViewModel>(); workoutViewModelQueryResult.HttpStatusCode = ofmQueryResult.HttpStatusCode; if ((int)ofmQueryResult.HttpStatusCode == 204) { workoutViewModelQueryResult.ViewModel = Mapper.Map <TViewModel>(ofmQueryResult.OfmForGet); } else { workoutViewModelQueryResult.ErrorMessagesPresented = ofmQueryResult.ErrorMessagesPresented; } return(workoutViewModelQueryResult); }