public override void BeforeTemplateExecution()
 {
     base.BeforeTemplateExecution();
     ExecutionContext.EventDispatcher.Publish(ContainerRegistrationRequest.ToRegister(this)
                                              .ForConcern("Application")
                                              .ForInterface(GetTemplate <IClassProvider>(ServiceContractTemplate.TemplateId, Model)));
 }
Exemple #2
0
 public override void BeforeTemplateExecution()
 {
     ExecutionContext.EventDispatcher.Publish(ContainerRegistrationRequest.ToRegister(this)
                                              .ForInterface(GetTemplate <IClassProvider>(DomainEventServiceInterfaceTemplate.TemplateId))
                                              .ForConcern("Infrastructure")
                                              .WithPerServiceCallLifeTime());
 }
 public override void BeforeTemplateExecution()
 {
     ExecutionContext.EventDispatcher.Publish(ContainerRegistrationRequest.ToRegister($"typeof({ClassName}<,>)")
                                              .ForInterface("typeof(IPipelineBehavior<,>)")
                                              .WithPriority(4)
                                              .ForConcern("Application")
                                              .RequiresUsingNamespaces("MediatR")
                                              .HasDependency(this));
 }
        public override void BeforeTemplateExecution()
        {
            ExecutionContext.EventDispatcher.Publish(new ConnectionStringRegistrationRequest(
                                                         name: $"{Project.Application.Name}DB",
                                                         connectionString: $"Server=.;Initial Catalog={ OutputTarget.Application.Name };Integrated Security=true;MultipleActiveResultSets=True",
                                                         providerName: "System.Data.SqlClient"));

            ExecutionContext.EventDispatcher.Publish(ContainerRegistrationRequest.ToRegister(this)
                                                     .WithPerServiceCallLifeTime());
        }
Exemple #5
0
 public override void BeforeTemplateExecution()
 {
     ExecutionContext.EventDispatcher.Publish(ContainerRegistrationRequest.ToRegister(this)
                                              .WithPerServiceCallLifeTime());
     //Project.Application.EventDispatcher.Publish(ContainerRegistrationEvent.EventId, new Dictionary<string, string>()
     //{
     //    { ContainerRegistrationEvent.InterfaceTypeKey, null},
     //    { ContainerRegistrationEvent.ConcreteTypeKey, $"{Namespace}.{ClassName}" },
     //    { ContainerRegistrationEvent.InterfaceTypeTemplateIdKey, null },
     //    { ContainerRegistrationEvent.ConcreteTypeTemplateIdKey, Identifier },
     //    { ContainerRegistrationEvent.LifetimeKey, ContainerRegistrationEvent.PerServiceCallLifetime }
     //});
 }
        public override void BeforeTemplateExecution()
        {
            var contractTemplate = Project.FindTemplateInstance <IClassProvider>(_repositoryInterfaceTemplateDependency);

            if (contractTemplate == null)
            {
                return;
            }

            ExecutionContext.EventDispatcher.Publish(ContainerRegistrationRequest.ToRegister(this)
                                                     .ForConcern("Infrastructure")
                                                     .ForInterface(contractTemplate));
            //Project.Application.EventDispatcher.Publish(ContainerRegistrationEvent.EventId, new Dictionary<string, string>()
            //{
            //    { "InterfaceType", $"{contractTemplate.Namespace}.{contractTemplate.ClassName}"},
            //    { "ConcreteType", $"{Namespace}.{ClassName}" },
            //    { "InterfaceTypeTemplateId", _repositoryInterfaceTemplateDependency.TemplateId },
            //    { "ConcreteTypeTemplateId", Identifier }
            //});
        }
Exemple #7
0
        public override void BeforeTemplateExecution()
        {
            ExecutionContext.EventDispatcher.Publish(ContainerRegistrationRequest.ToRegister(this).ForInterface("Intent.Framework.Core.Context.IContextBackingStore"));
            //Project.Application.EventDispatcher.Publish(ContainerRegistrationEvent.EventId, new Dictionary<string, string>()
            //{
            //    { "InterfaceType", "Intent.Framework.Core.Context.IContextBackingStore"},
            //    { "ConcreteType", $"{Namespace}.{ClassName}" }
            //});

            Project.Application.EventDispatcher.Publish(InitializationRequiredEvent.EventId, new Dictionary <string, string>()
            {
                { InitializationRequiredEvent.UsingsKey, $@"Intent.Framework.Core.Context;
{Namespace};" },
                { InitializationRequiredEvent.CallKey, "InitializeServiceCallContext();" },
                { InitializationRequiredEvent.MethodKey, $@"
        private void InitializeServiceCallContext()
        {{
            ServiceCallContext.SetBackingStore(new {ClassName}());
        }}" }
            });
        }
 public override void BeforeTemplateExecution()
 {
     ExecutionContext.EventDispatcher.Publish(ContainerRegistrationRequest.ToRegister(this)
                                              .ForInterface("IServiceProvider"));
 }
Exemple #9
0
 public override void BeforeTemplateExecution()
 {
     ExecutionContext.EventDispatcher.Publish(ContainerRegistrationRequest.ToRegister(this)
                                              .ForConcern("Application")
                                              );
 }