//Get the details of a particular player public TblPlayer GetPlayerData(int id) { try { TblPlayer player = db.TblPlayer.Find(id); return(player); } catch { throw; } }
//To Update the records of a particluar player public int UpdatePlayer(TblPlayer player) { try { db.Entry(player).State = EntityState.Modified; db.SaveChanges(); return(1); } catch { throw; } }
//To Add new player record public int AddPlayer(TblPlayer player) { try { db.TblPlayer.Add(player); db.SaveChanges(); return(1); } catch { throw; } }
//To Delete the record of a particular player public int DeletePlayer(int id) { try { TblPlayer emp = db.TblPlayer.Find(id); db.TblPlayer.Remove(emp); db.SaveChanges(); return(1); } catch { throw; } }