예제 #1
0
        public Drank Update(Drank drankChanges)
        {
            var drank = context.Dranken.Attach(drankChanges);

            drank.State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            context.SaveChanges();
            return(drankChanges);
        }
        public Drank Update(Drank drankChanges)
        {
            Drank drank = _DrankList.FirstOrDefault(e => e.Id == drankChanges.Id);

            if (drank != null)
            {
                drank.name              = drankChanges.name;
                drank.NameBrand         = drankChanges.NameBrand;
                drank.type              = drankChanges.type;
                drank.Quantity          = drankChanges.Quantity;
                drank.AlcoholPersentage = drankChanges.AlcoholPersentage;
            }
            return(drank);
        }
예제 #3
0
 public Drank Remove(Drank model)
 {
     throw new System.NotImplementedException();
 }
예제 #4
0
 public Drank Add(Drank drank)
 {
     context.Dranken.Add(drank);
     context.SaveChanges();
     return(drank);
 }
 public Drank Remove(Drank model)
 {
     _DrankList.Remove(model);
     return(model);
 }
 public Drank Add(Drank drank)
 {
     drank.Id = _DrankList.Max(e => e.Id) + 1;
     _DrankList.Add(drank);
     return(drank);
 }