Example #1
0
        /// <summary>
        /// Add the imageURI to the flummery being updated
        /// </summary>
        /// <param name="flummeryId">Id of flummery to add image to</param>
        /// <param name="imageURI">Image URI to add to the flummery, stored in cloud storage</param>
        /// <returns>Task of completion of updated Flummery</returns>
        public async Task <Flummery> UpdateStoreDbFor(int flummeryId, string imageURI)
        {
            Flummery flummery = await _flummeryInventory.GetFlummeryBy(flummeryId);

            flummery.ImageUrl = imageURI;
            return(await _flummeryInventory.UpdateFlummery(flummery));
        }
        /// <summary>
        /// Update the specified flummery in the database
        /// </summary>
        /// <param name="id">Id of flummery being updated</param>
        /// <returns>Updated flummery</returns>
        public async Task <Flummery> UpdateFlum(int id)
        {
            Flummery flum = new Flummery
            {
                Id           = id,
                Name         = Input.Name,
                Manufacturer = Input.Manufacturer,
                Price        = Input.Price,
                Calories     = Input.Calories,
                Weight       = Input.Weight,
                Compliment   = Input.Compliment
            };

            if (Input.ImageFile == null)
            {
                flum.ImageUrl = ImgUrl;
            }
            flum = await _flummery.UpdateFlummery(flum);

            return(flum);
        }