public void ConfigureServices(IServiceCollection services) { services .AddDbContext <FootballDbContext>(builder => { string connectionString = DbConnectionStrings.Resolve("Firestorm.FootballExample"); builder.UseSqlServer(connectionString); }); var fsBuilder = services.AddFirestorm() .AddEndpoints(new EndpointConfiguration { Response = { StatusField = ResponseStatusField.StatusCode, Pagination = { UseLinkHeaders = true }, ShowDeveloperErrors = true } }) .AddEntityFramework <FootballDbContext>(); _tech.Configure(fsBuilder); }
public void ConfigureServices(IServiceCollection services) { services .AddDbContext <MusicDbContext>(builder => { string connectionString = DbConnectionStrings.Resolve("Firestorm.MusicExample"); builder.UseSqlServer(connectionString); }); services.AddFirestorm() .AddEndpoints(ExampleConfiguration.EndpointConfiguration) .AddStems() .Add <ITypeGetter>(new NestedTypeGetter(_config.TestClassType)) .AddEntityFramework <MusicDbContext>(); }
public ExampleFixture() { var options = new DbContextOptionsBuilder <ExampleDataContext>() .UseSqlServer(DbConnectionStrings.Resolve("Firestorm.EntityFrameworkCore2Tests")) .Options; Context = new ExampleDataContext(options); Context.Database.EnsureCreated(); if (Context.Artists.Any()) { return; } Context.Artists.AddRange(ExampleDataSets.GetArtists()); Context.SaveChanges(); }
public ExampleDataContext() : base(DbConnectionStrings.Resolve("Firestorm.EntityFramework6Tests")) { }