コード例 #1
0
        //Get the details of a particular Game



        public TblGameDes GetGameData(int id)
        {
            try
            {
                TblGameDes game = db.TblGameDes.Find(id);
                return(game);
            }
            catch
            {
                throw;
            }
        }
コード例 #2
0
 //To Update the records of a particluar Game
 public int UpdateGame(TblGameDes game)
 {
     try
     {
         db.Entry(game).State = EntityState.Modified;
         db.SaveChanges();
         return(1);
     }
     catch
     {
         throw;
     }
 }
コード例 #3
0
 //To Add new Game Record
 public int AddGame(TblGameDes game)
 {
     try
     {
         db.TblGameDes.Add(game);
         db.SaveChanges();
         return(1);
     }
     catch
     {
         throw;
     }
 }
コード例 #4
0
 //To Delete the record of a particulargame
 public int DeleteGame(int id)
 {
     try
     {
         TblGameDes game = db.TblGameDes.Find(id);
         db.TblGameDes.Remove(game);
         db.SaveChanges();
         return(1);
     }
     catch
     {
         throw;
     }
 }