Ejemplo n.º 1
0
        public async Task <VendorDto> Create(Guid userId, VendorForCreationDto vendorForCreationDto)
        {
            var vendor = new Vendor()
            {
                Name  = vendorForCreationDto.Name,
                CUIL  = vendorForCreationDto.CUIL,
                Phone = vendorForCreationDto.Phone,
                Mail  = vendorForCreationDto.Mail,
                //Active = vendorForCreationDto.Active,
                Description = vendorForCreationDto.Description,
                CreatedBy   = userId
            };

            vendor = await _vendorRepository.Add(vendor);

            await _vendorRepository.CommitAsync();

            return(_mapper.Map <Vendor, VendorDto>(vendor));
        }