Beispiel #1
0
        public Classes(serverDBEntities context)
        {
            this.context = context;

            externalTeacherBehavior = new ExternalTeacher(context);
            specialLocationBehavior = new SpecialLocation(context);
            classesGroupBehavior    = new ClassesGroup(context);
            classesWeekBehavior     = new ClassesWeek(context);
        }
        public SpecialLocation GetSpecialLocationByIdWithLocalSearch(int specialLocationId)
        {
            var specialLocationsLocal = from specialLocation in context.SpecialLocation
                                        where specialLocation.ID == specialLocationId
                                        select specialLocation;

            SpecialLocation l = specialLocationsLocal.FirstOrDefault();

            if (l != null)
            {
                return(l);
            }

            var specialLocations = from specialLocation in context.SpecialLocation
                                   where specialLocation.ID == specialLocationId
                                   select specialLocation;

            return(specialLocations.FirstOrDefault());
        }