示例#1
0
 //Get the details of a particular player
 public TblPlayer GetPlayerData(int id)
 {
     try
     {
         TblPlayer player = db.TblPlayer.Find(id);
         return(player);
     }
     catch
     {
         throw;
     }
 }
示例#2
0
 //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;
     }
 }
示例#3
0
 //To Add new player record
 public int AddPlayer(TblPlayer player)
 {
     try
     {
         db.TblPlayer.Add(player);
         db.SaveChanges();
         return(1);
     }
     catch
     {
         throw;
     }
 }
示例#4
0
 //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;
     }
 }