Пример #1
0
        public async Task <ActionResult> ChangeName(Guid id, string name, int version)
        {
            try
            {
                var inventoryItem = await connection.GetById <InventoryItemLogic>(id);

                inventoryItem.ChangeName(name);
                await connection.Save(inventoryItem, version);

                return(NoContent());
            }
            catch (ArgumentException ex)
            {
                return(BadRequest(ex.Message));
            }
            catch (AggregateNotFoundException)
            {
                return(NotFound());
            }
        }