コード例 #1
0
        public async Task <HttpResult <ToggleMessageResponse> > Update(int id, ToggleUpdateMessageRequest request)
        {
            var retorno = new HttpResult <ToggleMessageResponse>();

            if (id <= 0)
            {
                return(retorno.SetToUnprocessableEntity(ServiceConstants.IDENTIFICADOR_INVALIDO));
            }
            if (request == null)
            {
                return(retorno.SetHttpStatusToBadRequest());
            }

            var retornoTaskUpdate = ToggleServiceTask.Update(id, request.Description, request.Flag, request.IdsServiceRota);

            retorno.Response = MapToResponseToggleMessage.MapToToggleMessageResponse(retornoTaskUpdate.Result.Response);
            retorno.Message  = retornoTaskUpdate.Result.Message;

            return(retorno);
        }
コード例 #2
0
 private Task <HttpResult <Toggle> > Update(int id, string description, bool flag, List <int> idsServiceRota)
 {
     return(task.Update(id, description, flag, idsServiceRota));
 }