コード例 #1
0
 public EventReminderBackgroundService(ILogger <EventReminderBackgroundService> logger, ICalendarDbContext calendarDbContext, INotify <GearRole> notify)
     : base("CalendarEvents", logger)
 {
     _calendarDbContext = calendarDbContext;
     _notify            = notify;
     Interval           = TimeSpan.FromMinutes(15);
 }
コード例 #2
0
ファイル: CalendarQuery.cs プロジェクト: sjefvanleeuwen/GEAR
        public CalendarQuery(ICalendarDbContext dbContext, IUserManager <GearUser> userManager)
        {
            Field <ListGraphType <EventType> >(
                "events",
                arguments: new QueryArguments(
                    new QueryArgument <IdGraphType> {
                Name = "id", Description = "Event id"
            },
                    new QueryArgument <DateGraphType> {
                Name = "startDate"
            },
                    new QueryArgument <DateGraphType> {
                Name = "endDate"
            }
                    ),
                resolve: context =>
            {
                var id = context.GetArgument <Guid?>("id");
                if (id != null)
                {
                    return(dbContext.CalendarEvents.Where(x => x.Id.Equals(id)).ToListAsync().Result);
                }

                return(dbContext.CalendarEvents.ToListAsync().Result);
            });

            Field <ListGraphType <UserType> >("users",
                                              arguments: new QueryArguments(
                                                  new QueryArgument <IdGraphType> {
                Name = "id", Description = "User id"
            }
                                                  ),
                                              resolve: ctx => userManager.UserManager.Users.ToListAsync());
        }
コード例 #3
0
 public CalendarManager(ICalendarDbContext context, IUserManager <GearUser> userManager, IOrganizationService <Tenant> organizationService, IHttpContextAccessor contextAccessor)
 {
     _context             = context;
     _userManager         = userManager;
     _organizationService = organizationService;
     _contextAccessor     = contextAccessor;
 }
コード例 #4
0
 public UserType(ICalendarDbContext dbContext)
 {
     Field(x => x.Id, type: typeof(IdGraphType)).Description("User id");
     Field(x => x.Email).Description("User email");
     Field("FirstName", x => x.FirstName);
     Field("LastName", x => x.LastName);
     Field(x => x.UserName);
     Field <ListGraphType <EventType> >("events", resolve: ctx => dbContext.CalendarEvents.Where(x => x.Organizer.Equals(ctx.Source.Id)).ToListAsync().Result);
 }
コード例 #5
0
ファイル: EventType.cs プロジェクト: sjefvanleeuwen/GEAR
 public EventType(ICalendarDbContext dbContext, IUserManager <GearUser> userManager)
 {
     Field(x => x.Id, type: typeof(IdGraphType));
     Field(x => x.Title).Description("Event title");
     Field(x => x.Details).Description("Event details");
     Field(x => x.StartDate).Description("Event details");
     Field(x => x.EndDate).Description("Event details");
     Field(x => x.Author).Description("Event author");
     Field(x => x.Version).Description("Event version");
     Field(x => x.ModifiedBy).Description("Event author");
     Field(x => x.Created).Description("Event author");
     Field(x => x.Changed).Description("Event author");
     Field(x => x.Organizer, type: typeof(IdGraphType)).Description("Organizer id");
     Field <UserType>("organizerInfo", resolve: ctx => userManager.UserManager.Users.FirstOrDefaultAsync(x => x.Id.Equals(ctx.Source.Organizer)).Result);
     Field <ListGraphType <EventMemberType> >("InvitedUsers",
                                              resolve: context => dbContext.EventMembers.Where(x => x.EventId.Equals(context.Source.Id)).ToListAsync().Result);
 }
コード例 #6
0
 public CalendarExternalTokenProvider(ICalendarDbContext context)
 {
     _context = context;
 }
コード例 #7
0
 public CalendarUserSettingsService(ICalendarDbContext context)
 {
     _context = context;
 }