public static void AddContext(this IServiceCollection services) { var options = new DbContextOptionsBuilder <MovieRentalSystemContext>() .UseInMemoryDatabase("MovieRentalSystem") .ConfigureWarnings(x => x.Ignore(InMemoryEventId.TransactionIgnoredWarning)) .Options; var context = new MovieRentalSystemContext(options); //coloquei Singleton nesse caso pelo fato de está trabalhando com os dados in memory. services.AddSingleton(context); }
public RepositoryBase(MovieRentalSystemContext context) { this.context = context; }