public IQueryable <TReadModel> Read <TReadModel>() where TReadModel : class, IKeyReadModel { var mapping = ReadModelMappingsFactory.CreateMapping <TEntity, TReadModel>(); return(_context.Set <TEntity>().AsExpandable().Select(mapping)); }
public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseCors("AllowEverything"); app.UseMiddleware <ExceptionMiddleware>(); MigrationsHelper.MigrateAndSeed(env, app); app.UseSignalR(options => { options.MapHub <ExecuteTestHub>("/hubs/execute-test"); options.MapHub <RunningRunHub>("/hubs/running-run"); }); app.UseMvc(); ReadModelMappingsFactory.RegisterMappings(); }