public void Post([FromBody] Ember újEmber) { AdatokContext context = new AdatokContext(); context.Embers.Add(újEmber); context.SaveChanges(); }
public Ember Get(int id) { AdatokContext context = new AdatokContext(); var adatKeres = (from x in context.Embers where x.Id == id select x).FirstOrDefault(); return(adatKeres); }
public void Delete(int id) { AdatokContext context = new AdatokContext(); var törlés = (from x in context.Embers where x.Id == id select x).FirstOrDefault(); context.Remove(törlés); context.SaveChanges(); }
public IEnumerable <Ember> Get() { AdatokContext context = new AdatokContext(); return(context.Embers.ToList()); }