ASPNETCoreAngular2Demo.Repositories.FoodRepository.Update C# (CSharp) Метод

Update() публичный Метод

public Update ( FoodItem toUpdate ) : FoodItem
toUpdate ASPNETCoreAngular2Demo.Models.FoodItem
Результат ASPNETCoreAngular2Demo.Models.FoodItem
        public FoodItem Update(FoodItem toUpdate)
        {
            FoodItem single = GetSingle(toUpdate.Id);

            if (single == null)
            {
                return null;
            }

            _foods[single.Id] = toUpdate;
            return toUpdate;
        }