Inegrate calendi in meeting Schedule
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

35 lines
1.2 KiB

using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Castle.MicroKernel.Registration;
using Castle.Windsor.MsDependencyInjection;
using Abp.Dependency;
using MeetingSchedule.EntityFrameworkCore;
using MeetingSchedule.Identity;
namespace MeetingSchedule.Tests.DependencyInjection
{
public static class ServiceCollectionRegistrar
{
public static void Register(IIocManager iocManager)
{
var services = new ServiceCollection();
IdentityRegistrar.Register(services);
services.AddEntityFrameworkInMemoryDatabase();
var serviceProvider = WindsorRegistrationHelper.CreateServiceProvider(iocManager.IocContainer, services);
var builder = new DbContextOptionsBuilder<MeetingScheduleDbContext>();
builder.UseInMemoryDatabase(Guid.NewGuid().ToString()).UseInternalServiceProvider(serviceProvider);
iocManager.IocContainer.Register(
Component
.For<DbContextOptions<MeetingScheduleDbContext>>()
.Instance(builder.Options)
.LifestyleSingleton()
);
}
}
}