public async Task <ActionResult <VmEquipment> > PostEquipment([FromBody] VmEquipment vmEquipment, CancellationToken cancellationToken)
        {
            var equipmentView = _mapper.Map <EquipmentView>(vmEquipment);
            var dbEquipment   = await _equipmentService.AddEquipmentAsync(equipmentView, cancellationToken);

            await _equipmentService.CommitAsync(cancellationToken);

            vmEquipment.Id = dbEquipment.Id;
            return(CreatedAtAction("GetEquipment", new { id = dbEquipment.Id }, vmEquipment));
        }
예제 #2
0
        public async Task <ActionResult <Result> > AddEquipmentAsync(MedEquipmentDto equipment)
        {
            var result = await _equipmentService.AddEquipmentAsync(equipment);

            return(result);
        }
        public async Task <IActionResult> AddEquipment([FromBody] AddEquipmentFormModel equipmentForm)
        {
            var equipments = await _equipmentService.AddEquipmentAsync(HttpContext.GetUser(), equipmentForm);

            return(Ok(GetRequestResult(equipments)));
        }