/// <summary> /// Récupére l'entité désignée par l'id en paramétre. /// </summary> /// <param name="id">Id de l'entité</param> /// <returns>Message de retour avec l'entité</returns> public async Task <DTO.WorkflowConfig> GetById(long id) { ENT.WorkflowConfig workflowConfig = await WorkflowConfigDomain.Get(id); DTO.WorkflowConfig dtoWorkflowConfig = null; if (workflowConfig != null) { dtoWorkflowConfig = Mapper.Map <ENT.WorkflowConfig, DTO.WorkflowConfig>(workflowConfig); } return(dtoWorkflowConfig); }
/// <summary> /// This function permits to update a config /// </summary> /// <param name="workflowConfig"></param> /// <returns>WorkflowConfig</returns> public async Task <DTO.WorkflowConfig> Put(DTO.WorkflowConfig workflowConfig) { return(Mapper.Map <ENT.WorkflowConfig, DTO.WorkflowConfig>( await WorkflowConfigDomain.Update(Mapper.Map <DTO.WorkflowConfig, ENT.WorkflowConfig>(workflowConfig)))); }
/// <summary> /// /// </summary> /// <param name="workflowConfig"></param> /// <returns></returns> public async Task <DTO.WorkflowConfig> Post(DTO.WorkflowConfig workflowConfig) { ENT.WorkflowConfig element = Mapper.Map <DTO.WorkflowConfig, ENT.WorkflowConfig>(workflowConfig); return(Mapper.Map <ENT.WorkflowConfig, DTO.WorkflowConfig>(await WorkflowConfigDomain.Add(element))); }