public int Update(Player item) { using (var context = new ContextFSIS()) { context.Entry(item).State = System.Data.Entity.EntityState.Modified; return(context.SaveChanges()); } }
public int Add(Player item) { using (var context = new ContextFSIS()) { context.Player.Add(item); context.SaveChanges(); return(item.PlayerID); } }
public int Add(Player person) { using (var context = new ContextFSIS()) { context.Players.Add(person); context.SaveChanges(); return(person.PlayerID); } }
public int Delete(int productid) { using (var context = new ContextFSIS()) { var existing = context.Player.Find(productid); if (existing == null) { throw new Exception("Player has been removed from database"); } context.Player.Remove(existing); return(context.SaveChanges()); } }