Ejemplo n.º 1
0
        public async Task UpdateAsync(Guid id, string name, string nameEng, string description, string descriptionEng, bool isActive, decimal price, ShipmentType type)
        {
            var shipment = await shipmentRepository.GetAndEnsureExistAsync(id);

            shipment.SetName(name);
            shipment.SetEngName(nameEng);
            shipment.SetDescription(description);
            shipment.SetDescriptionEng(descriptionEng);
            shipment.SetIsActive(isActive);
            shipment.SetPrice(price);
            shipment.SetType(type);

            await shipmentRepository.SaveChangesAsync();
        }
        public async Task <ShipmentDto> GetAsync(Guid id)
        {
            var shipment = await shipmentRepository.GetAndEnsureExistAsync(id);

            return(mapper.Map <ShipmentDto>(shipment));
        }