ASPNETCoreAngular2Demo.Repositories.FoodRepository.Update C# (CSharp) Method

Update() public method

public Update ( FoodItem toUpdate ) : FoodItem
toUpdate ASPNETCoreAngular2Demo.Models.FoodItem
return ASPNETCoreAngular2Demo.Models.FoodItem
        public FoodItem Update(FoodItem toUpdate)
        {
            FoodItem single = GetSingle(toUpdate.Id);

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

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