Exemplo n.º 1
0
        protected virtual async Task Create(CreateOrEditDeliverableDto input)
        {
            var deliverable = ObjectMapper.Map <Deliverable>(input);

            await _organizationUnitManager.CreateAsync(deliverable);

            await CurrentUnitOfWork.SaveChangesAsync();
        }
Exemplo n.º 2
0
        protected virtual async Task Update(CreateOrEditDeliverableDto input)
        {
            var deliverable = await _deliverableRepository.FirstOrDefaultAsync((int)input.Id);

            var mapped = ObjectMapper.Map(input, deliverable);
            await _organizationUnitManager.UpdateAsync(mapped);

            await CurrentUnitOfWork.SaveChangesAsync();
        }
Exemplo n.º 3
0
 public async Task CreateOrEdit(CreateOrEditDeliverableDto input)
 {
     if (input.Id == null)
     {
         await Create(input);
     }
     else
     {
         await Update(input);
     }
 }