示例#1
0
        public async Task <IActionResult> Put([FromBody] UpdatePriceEntity updatePrice)
        {
            try
            {
                var result = await Task <int> .Run(() => business_Repo.UpdateItemPrice(updatePrice));

                if (result > 0)
                {
                    await messagePublisher.SendMessageAsync(new UpdatePriceEntity
                    {
                        TblMenuId       = updatePrice.TblMenuId,
                        TblRestaurantId = updatePrice.TblRestaurantId,
                        Price           = updatePrice.Price
                    });

                    return(Ok("Price Updated Successfully"));
                }

                return(this.BadRequest("Failed to update , please try again later"));
            }
            catch (Exception e)
            {
                throw e;
            }
        }