Esempio n. 1
0
        public static void RegisterComponents()
        {
            var container = new UnityContainer();

            container.RegisterType <IUsuarioRepository, UsuarioRepositoryEF>();
            container.RegisterType <ICursoRepository, CursoRepositoryEF>();
            container.RegisterType <IAlunoRepository, AlunoRepositoryEF>();
            container.RegisterType <ITurmaRepository, TurmaRepositoryEF>();
            container.RegisterType <ITrabalhoRepository, TrabalhoRepositoryEF>();
            container.RegisterType <IOrientadorRepository, OrientadorRepositoryEF>();
            PFCSGPDataContext context = new PFCSGPDataContext();

            container.RegisterInstance <PFCSGPDataContext>(context);

            DependencyResolver.SetResolver(new UnityDependencyResolver(container));
        }
Esempio n. 2
0
 public RepositoryEF(PFCSGPDataContext ctx)
 {
     _ctx = ctx;
 }
 public TrabalhoRepositoryEF(PFCSGPDataContext context) : base(context)
 {
 }
 public TurmaRepositoryEF(PFCSGPDataContext context) : base(context)
 {
 }
 public CursoRepositoryEF(PFCSGPDataContext context) : base(context)
 {
 }
 public OrientadorRepositoryEF(PFCSGPDataContext context) : base(context)
 {
 }
 public UsuarioRepositoryEF(PFCSGPDataContext context) : base(context)
 {
 }
 public AlunoRepositoryEF(PFCSGPDataContext context) : base(context)
 {
 }