示例#1
0
        private static string GetIncludeProperties(UsersToEventRelatedData includes)
        {
            string includeProperties = "";

            switch (includes)
            {
            case UsersToEventRelatedData.None:
                break;

            case UsersToEventRelatedData.Events:
                includeProperties = @"Event";
                break;

            default:
                break;
            }

            return(includeProperties);
        }
示例#2
0
 public static List <UsersToEvent> GetPagedUsersToEventsByUserID(int userID, int pageNumber, int pageSize = int.MaxValue, UsersToEventRelatedData relatedData = UsersToEventRelatedData.None)
 {
     using (IUnitOfWork unitOfWork = new cmiUnitOfWork())
     {
         Repository <UsersToEvent> repository = new Repository <UsersToEvent>(unitOfWork);
         List <UsersToEvent>       events     = repository.Get(e => e.UserID == userID && e.Event.StartTime > DateTime.Today, GetIncludeProperties(relatedData)).OrderBy(e => e.Event.StartTime).ToPagedList(pageNumber, pageSize).ToList();
         return(events);
     }
 }