예제 #1
0
 public Race GetRace(int id)
 {
     // Utilisation d'Entity Framework
     using (var context = new WebSportPsEntities())
     {
         return(context.GetRaceById(id).First().ToBo());
     }
 }
예제 #2
0
        public Race GetRace(int id)
        {
            // Utilisation d'Entity Framework
            using (var context = new WebSportPsEntities())
            {
                return(context.GetRaceById(id).First().ToBo());
            }

            // Si on utilise ADO.NET en direct, on utiliserait le code ci-dessous
            //var instance = new DbTools();
            //var command = instance.CreerProcedureStockee(RQT_GET_RACE_PS);
            //instance.CreerParametre(command, "@id", id, ParameterDirection.Input, DbType.Int32);

            //DbDataReader reader = command.ExecuteReader();
            //return this.BuildRace(reader);
        }