Пример #1
0
        private void EventController_GetIncludeEvent(object sender, GetIncludeEventArgs <Event> e)
        {
            List <string> propertyPaths = e.PropertyPaths.ToLower().Split(";", StringSplitOptions.RemoveEmptyEntries).ToList();

            propertyPaths.ForEach(p => p = p.Trim());
            IQueryable <Event> root = e.EntityQuery;

            if (propertyPaths.Contains("locations.schedules"))
            {
                root = e.Include = root.Include(e => e.Locations).ThenInclude(l => l.Schedules);
            }
            else if (propertyPaths.Contains("locations"))
            {
                root = e.Include = root.Include(e => e.Locations);
            }

            if (propertyPaths.Contains("schedules.location"))
            {
                root = e.Include = root.Include(e => e.Schedules).ThenInclude(s => s.Location);
            }
            else if (propertyPaths.Contains("schedules"))
            {
                root = e.Include = root.Include(e => e.Schedules);
            }

            if (propertyPaths.Contains("occurrences"))
            {
                root = e.Include = root.Include(e => e.Occurances);
            }

            if (propertyPaths.Contains("services"))
            {
                root = e.Include = root.Include(e => e.Services);
            }
        }
Пример #2
0
        private void ServiceHelper_GetIncludeEvent(object sender, GetIncludeEventArgs <EventService> e)
        {
            List <string> propertyPaths = e.PropertyPaths.ToLower().Split(";", StringSplitOptions.RemoveEmptyEntries).ToList();

            propertyPaths.ForEach(p => p = p.Trim());
            IQueryable <EventService> root = e.EntityQuery;
        }
Пример #3
0
        public virtual IIncludableQueryable <TEntity, object> GetInclude(IQueryable <TEntity> entityQuery, string includePropertyPaths)
        {
            EventHandler <GetIncludeEventArgs <TEntity> > eventHandler = GetIncludeEvent;
            GetIncludeEventArgs <TEntity> args = new GetIncludeEventArgs <TEntity>(entityQuery, includePropertyPaths);

            eventHandler?.Invoke(this, args);
            return(args.Include);
        }
Пример #4
0
        private void ScheduleHelper_GetIncludeEvent(object sender, GetIncludeEventArgs <EventSchedule> e)
        {
            List <string> propertyPaths = e.PropertyPaths.ToLower().Split(";", StringSplitOptions.RemoveEmptyEntries).ToList();

            propertyPaths.ForEach(p => p = p.Trim());
            IQueryable <EventSchedule> root = e.EntityQuery;

            if (propertyPaths.Contains("location"))
            {
                root = e.Include = root.Include(e => e.Location);
            }
        }
 private void ExtendedLogController_GetIncludeEvent(object sender, GetIncludeEventArgs <ExtendedLog> e)
 {
     e.Include = null;
 }
Пример #6
0
 private void NotificationController_GetIncludeEvent(object sender, GetIncludeEventArgs <Notification> e)
 {
     e.Include = null;
 }