public ActionResult <string> Put(string requestId, long timestamp, [FromBody] DTOEditorial editorialDTO) { CustomRequest request = new CustomRequest(requestId, Entity.CustomRequest.FLAG_UPDATE, editorialDTO, editorialDTO.Id); EditorialRequestActions editorialRequest = new EditorialRequestActions(request, CustomScope); RequestManager requestManager = new RequestManager(timestamp, editorialRequest); requestsPile.AddRequest(editorialDTO.Id, requestManager); return(Program.REQ_RESPONSE_POSITIVE); }
public EditorialRequestActions(CustomRequest request, CustomScope customScope) { Scope = customScope; Request = request; EMapper = new EditorialMapper(); if (request.Dto.GetType() == typeof(DTOEditorial)) { Dto = (DTOEditorial)Convert.ChangeType(request.Dto, typeof(DTOEditorial)); } else { Dto = null; } }
/// <summary> /// Maps the DTO to the entity. /// </summary> /// <param name="editorial"> The editorial entity. </param> /// <param name="editorialDTO"> The editorial DTO. </param> public void MapDTO(Editorial editorial, DTOEditorial editorialDTO) { editorial.Id = editorialDTO.Id; editorial.Name = editorialDTO.Name; }