private async Task <IEnumerable <Employees> > PullAsync(BirthdayContext dbContext, int[] monthDay) { try { var Bday = dbContext.Employees.Where(x => x.Birthday.Value.Month == monthDay[0] && x.Birthday.Value.Day == monthDay[1]); return(Bday); } catch (Exception) { _logger.LogInformation("Pulling Employees, whose birthday is tomorrow, failed."); return(null); } }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { app.UseSwagger(); app.UseSwaggerUI(options => options.SwaggerEndpoint("/swagger/v1/swagger.json", "Birthday Tracker v1") ); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseMvc(); BirthdayContext.SeedData(app.ApplicationServices); }
public BirthdayRepo(BirthdayContext dbContext) =>
public BirthdaysController(BirthdayContext context) { _context = context; }