// POST: api/ToGoList public void Post(ToGo ToGo) { string owner = ClaimsPrincipal.Current.FindFirst(ClaimTypes.NameIdentifier).Value; ToGo.Owner = owner; db.ToGoes.Add(ToGo); db.SaveChanges(); }
public void Put(ToGo ToGo) { string owner = ClaimsPrincipal.Current.FindFirst(ClaimTypes.NameIdentifier).Value; ToGo xToGo = db.ToGoes.First(a => a.Owner == owner && a.ID == ToGo.ID); if (ToGo != null) { xToGo.Description = ToGo.Description; db.SaveChanges(); } }