/// <summary>
 ///   Performs wireup.
 /// </summary>
 /// <param name="coordinator"></param>
 /// <param name="context"></param>
 protected override void PerformTask(IWireupCoordinator coordinator, WireupContext context)
 {
     context.Sequence.Push(string.Concat("Registering wireup observer: ",
                                         typeof(HookWirupCoordinatorTask).GetReadableFullName()));
     // Attach the root container as a wireup observer...
     coordinator.RegisterObserver(DTOWireupObserver.Observer);
 }
        public void Execute(IWireupCoordinator coordinator)
        {
            Container.Root
                     .ForType<IDbConnection>()
                     .Register<SqlConnection>()
                     .ResolveAnInstancePerRequest()
                     .End();

            Container.Root
                     .ForGenericType(typeof(IRepository<>))
                     .Register(typeof(Repository<>))
                     .ResolveAnInstancePerScope()
                     .End();

            Container.Root
                     .ForGenericType(typeof(IBatchRepository<>))
                     .Register(typeof(Repository<>))
                     .ResolveAnInstancePerScope()
                     .End();

            Container.Root
                     .ForGenericType(typeof(IReadOnlyRepository<>))
                     .Register(typeof(Repository<>))
                     .ResolveAnInstancePerScope()
                     .End();

        }
Esempio n. 3
0
            public void NotifyWireupTask(IWireupCoordinator coordinator, WireupTaskAttribute task, Type target)
            {
                var cra = task as DTOAttribute;

                if (cra != null && target != null)
                {
                    var concreteMethod = ConcreteTypeMethod.MakeGenericMethod(target);
                    var concrete       = (Type)concreteMethod.Invoke(null, null);
                    var reg            = RegisterMethod.MakeGenericMethod(target, concrete);
                    reg.Invoke(FactoryProvider.Factory, null);
                }
            }
		public void Execute(IWireupCoordinator coordinator)
		{
			Container.Root
					 .ForGenericType(typeof(IMapper<>))
					 .Register(typeof(DtoMapper<>))
					 .End();

			Container.Root
					 .ForType<IDbConnection>()
					 .Register(typeof(SqlConnection), Param.FromValue("data source=sqlb.streamlinedb.com;initial catalog=npdb;User Id=sa;Password=a12qrt?;MultipleActiveResultSets=True;"))
					 .ResolveAnInstancePerRequest()
					 .End();
		}
        public void Execute(IWireupCoordinator coordinator)
        {
            Container.Root
                     .ForGenericType(typeof(IReadOnlyRepository<>))
                     .Register(typeof(Repository<>))
                     .End();

            Container.Root
                     .ForGenericType(typeof(IRepository<>))
                     .Register(typeof(Repository<>))
                     .ResolveAnInstancePerScope()
                     .End();
        }
        /// <summary>
        /// Executes the command.
        /// </summary>
        /// <param name="coordinator">the wireup coordinator</param>
        public void Execute(IWireupCoordinator coordinator)
        {
            Container.Root
                     .ForType<DbContext>()
                     .Register<TestDbContext>()
                     .ResolveAnInstancePerScope()
                     .End();

            Container.Root
                    .ForType<IDbContextFactory>()
                    .Register<DefaultDbContextFactory>()
                    .ResolveAnInstancePerScope()
                    .End();

            Container.Root
                .ForGenericType(typeof (IRepository<>))
                .Register(typeof (Repository<>))
                .ResolveAnInstancePerScope()
                .End();



        }
 public void Execute(IWireupCoordinator coordinator)
 {
     
 }
Esempio n. 8
0
    /// <summary>
    ///   Called by the wireup framework when this assembly is wired.
    /// </summary>
    /// <param name="coordinator"></param>
    public void Execute(IWireupCoordinator coordinator)
    {
      // TODO: Add code that prepares your assembly for use. 
      // When this method exits your assembly should be in a ready-state.

    }
 public void Execute(IWireupCoordinator coordinator)
 {
 }
Esempio n. 10
0
 /// <summary>
 ///   Called by the wireup framework when this assembly is wired.
 /// </summary>
 /// <param name="coordinator"></param>
 public void Execute(IWireupCoordinator coordinator)
 {
     // TODO: Add code that prepares your assembly for use.
     // When this method exits your assembly should be in a ready-state.
 }
 public void Execute(IWireupCoordinator coordinator)
 {
     GlobalConfiguration.Configuration.Services.Replace(typeof(IHttpControllerActivator), new WebApiDtoHttpControllerActivator());
     GlobalConfiguration.Configuration.Services.Insert(typeof(ModelBinderProvider), 0, new WebApiDtoModelBinderProvider());
     GlobalConfiguration.Configuration.Formatters[0] = new DtoJsonNetFormatter();
 }
Esempio n. 12
0
 /// <summary>
 ///   Placeholder for business logic.
 /// </summary>
 protected override void PerformTask(IWireupCoordinator coordinator, WireupContext context)
 {
 }