public Principal() { InitializeComponent(); _instance = this; var unitOfWork = Injection.Get<IUnitOfWork>(); var alunoRepository = Injection.Get<IAlunoRepository>(); var turmaRepository = Injection.Get<ITurmaRepository>(); _turmaService = new TurmaService(turmaRepository, unitOfWork); _alunoService = new AlunoService(alunoRepository, turmaRepository, unitOfWork); AtualizaListaTurmas(); SelecionaTurmaAnoAtual(); }
public Principal() { InitializeComponent(); _instance = this; var factory = new DatabaseFactory(); var unitOfWork = new UnitOfWork(factory); var turmaRepository = new TurmaRepository(factory); var alunoRepository = new AlunoRepository(factory); _turmaService = new TurmaService(turmaRepository, unitOfWork); _alunoService = new AlunoService(alunoRepository, turmaRepository, unitOfWork); AtualizaListaTurmas(); SelecionaTurmaAnoAtual(); }