public AddCommand(OneContext oneContext, IMapper mapper, IDateTimeService dateTimeService) { this.oneContext = oneContext; this.mapper = mapper; this.dateTimeService = dateTimeService; }
public AddStoryCommand(OneContext context, IDateTimeService dateTimeService, IMapper mapper) { this.context = context; this.dateTimeService = dateTimeService; this.mapper = mapper; }
private void Dispose(bool disposing) { if (disposing) { if (_context != null) { _context.Dispose(); _context = null; } } }
public void BaseInMemoryTestSetup() { var serviceCollection = new ServiceCollection() .AddEntityFrameworkInMemoryDatabase() .AddAutoMapper(typeof(Startup)); _serviceProvider = serviceCollection.BuildServiceProvider(); var options = new DbContextOptionsBuilder <OneContext>() .UseInMemoryDatabase("OneContext") .UseInternalServiceProvider(_serviceProvider) .Options; _context = new OneContext(options); _context.Database.EnsureCreated(); }
public OneContext one() { OneContext _localctx = new OneContext(_ctx, State); EnterRule(_localctx, 6, RULE_one); try { EnterOuterAlt(_localctx, 1); { State = 23; Match(NUMBER); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.ReportError(this, re); _errHandler.Recover(this, re); } finally { ExitRule(); } return(_localctx); }
public UnitOfWork(OneContext context) { _context = context; }
public HomeController(OneContext context) => this.context = context;
public SearchStoryQuery(OneContext oneContext, IMapper mapper) { this.oneContext = oneContext; this.mapper = mapper; }
public GetFeatureListQuery(OneContext context) { this.context = context; }
public CommentsController(AuthStore authStore, OneContext context) { AuthStore = authStore; Context = context; }
public GEParentescoRepository(OneContext context) : base(context) { }
public StoryExistsImpl(OneContext oneContext) { this.oneContext = oneContext; }
public GEEndercoRepository(OneContext context) : base(context) { }
public UsersController(OneContext context) { Context = context; }
public SEGUsuarioRepositopry(OneContext context) : base(context) { }
public WorkController(OneContext context) { Context = context; }
protected virtual void Application_EndRequest() { OneContext.End(); }
protected virtual void Application_BeginRequest() { OneContext.Begin(); }
public UpdateStoryCommand(OneContext oneContext, IUpdateCommand updateCommand) { this.oneContext = oneContext; this.updateCommand = updateCommand; }
public ACNivelRepository(OneContext context) : base(context) { }
public UnitOfWorkTransaction(OneContext db) => _db = db;
public AccessController(OneContext context, AuthStore store, SecretStore secretStore) { Context = context; Store = store; this.secretStore = secretStore; }
public GECidadeRepository(OneContext context) : base(context) { }
public GEUFRepository(OneContext context) : base(context) { }
public TopicCreatedEventHandler(OneContext context) { Context = context; }
static void Main(string[] args) { var context = new OneContext(new Microsoft.EntityFrameworkCore.DbContextOptions <OneContext>()); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { using (var context = new OneContext(new DbContextOptions <OneContext>())) { context.Database.Migrate(); } // Secret store for JWT // TODO: put secret in env in docker-compose var secret = new byte[] { 164, 60, 194, 0, 161, 189, 41, 38, 130, 89, 141, 164, 45, 170, 159, 209, 69, 137, 243, 216, 191, 131, 47, 250, 32, 107, 231, 117, 37, 158, 225, 234 }; services.AddSingleton(s => new SecretStore(secret)); services.AddControllers(p => p.Filters.Add(new MyModelFilter())).AddNewtonsoftJson(cfg => { // contact generated by swagger does not include the number value of enum, // so the safest way of building contract of enum types is string. cfg.SerializerSettings.Converters.Add(new StringEnumConverter()); }); services.Configure <ApiBehaviorOptions>(options => options.SuppressModelStateInvalidFilter = true); // Register the Swagger generator, defining 1 or more Swagger documents services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new Microsoft.OpenApi.Models.OpenApiInfo { Title = "TheAPI", Version = "v1" }); c.CustomOperationIds(apiDesc => { return(apiDesc.TryGetMethodInfo(out MethodInfo methodInfo) ? methodInfo.Name : null); }); // Without this, client cannot send correct data c.DescribeAllEnumsAsStrings(); var filePath = Path.Combine(System.AppContext.BaseDirectory, "Leopard.API.xml"); c.IncludeXmlComments(filePath); }); // The c# world has get used to the behavior of Newtonsoft.Json. // There's no reason of switching to System.Text.Json services.AddSwaggerGenNewtonsoftSupport(); services.AddScoped <AuthenticationMiddleware>(); services.AddMediatR(Assembly.GetExecutingAssembly()); services.AddDbContext <OneContext>(); services.AddScoped <AuthStore>(); var blobStorePath = Environment.GetEnvironmentVariable("BLOB_STORE"); blobStorePath = blobStorePath ?? throw new InvalidOperationException("$BLOB_STORE is null"); services.AddTransient <IBlobBucket>((s) => new FileBucket(new DirectoryInfo(blobStorePath), "/blob")); // add filters Assembly.GetExecutingAssembly().GetTypes() .Where(p => p.GetInterfaces().Contains(typeof(IAsyncActionFilter))) .ToList().ForEach(filterType => services.AddTransient(filterType)); // add pipeline contexts Assembly.GetExecutingAssembly().GetTypes() .Where(p => p.GetInterfaces().Contains(typeof(IPipelineContext))) .ToList().ForEach(contextType => services.AddScoped(contextType)); }
public GetStoryQuery(OneContext context, IMapper mapper) { this.context = context; this.mapper = mapper; }
public DeleteOptionCommand(OneContext oneContext) { this.oneContext = oneContext; }
public TopicTest() { Context = new OneContext(new DbContextOptions <OneContext>()); }