public ActionResult Post([FromBody] GroupTypeRequest groupTypeRequest) { var entity = groupTypeRequest.TO <GroupType>(); var result = _repository.Add(entity); return(CreatedAtAction(nameof(Get), new { id = result.GroupTypeId }, result.TO <GroupTypeResponse>())); }
public ActionResult Put(Guid id, [FromBody] GroupTypeRequest groupTypeRequest) { var entity = _repository.Get(id); if (entity != null) { entity = groupTypeRequest.CopyTo(entity); _repository.Update(entity); return(new OkObjectResult(entity.TO <GroupTypeResponse>())); } return(new NoContentResult()); }
public BaseResponse UpdateGroupType(GroupTypeRequest request) { BaseResponse groupTypeResponse = new BaseResponse(); try { var orderID = repository.UpdateGroupType(request.groupType); groupTypeResponse.Success = true; } catch (Exception ex) { groupTypeResponse.Success = false; groupTypeResponse.Message = ex.Message; groupTypeResponse.StackTrace = ex.StackTrace; } return(groupTypeResponse); }
public BaseResponse UpdateGroupType(GroupTypeRequest request) { return(service.UpdateGroupType(request)); }
public BaseResponse CreateGroupType(GroupTypeRequest request) { return(service.InsertGroupType(request)); }