Exemplo n.º 1
0
        /// <summary>
        /// Update a component in the component database
        /// </summary>
        /// <param name="id">Component id to update</param>
        /// <param name="updateComponentViewModel">Values to change on the component</param>
        /// <returns></returns>
        public async Task UpdateComponent(int id, UpdateComponentViewModel updateComponentViewModel)
        {
            var component = await ComponentDatabase.GetById(id);

            if (component == null)
            {
                throw new Exception($"the requested id - {id} - was not found.");
            }

            component.Status = updateComponentViewModel.Status;
        }