Exemplo n.º 1
0
        public Class1()
        {
            db2019EventsStudentEntities = new Db2019EventsStudentEntities();

            //student only alcool
            db2019EventsStudentEntities.Drink.Where(d => d.DrinkType.AlcoholContent != 0).Select(d => d.MemberId).Distinct().ToList();

            //student event free
            db2019EventsStudentEntities.Participation.Where(p => p.Credit == 0).Select(p => p.MemberId).Distinct().ToList();
        }
Exemplo n.º 2
0
 public static List <DrinkTypeModel> Get()
 {
     using (var context = new Db2019EventsStudentEntities())
     {
         return(context.DrinkType.Select(d => new DrinkTypeModel()
         {
             Decription = d.Description, Id = d.Id, AlcoholContent = (double)d.AlcoholContent
         }).ToList());
     }
 }
Exemplo n.º 3
0
 public EventService()
 {
     context = new Db2019EventsStudentEntities();
 }