private void AddBllBindings() { ninjectKernel.Bind <IProductService>().To <ProductManager>().WithConstructorArgument("productDal", new EfProduct()); ninjectKernel.Bind <ICategoryService>().To <CategoryManager>().WithConstructorArgument("categoriesDal", new EfCategory()); ninjectKernel.Bind <IAuthenticationService>().To <AuthenticationManager>().WithConstructorArgument("authenticationDal", new EfAuthenticationDal()); //Loglama Kaydediliyor. ninjectKernel.Intercept(p => (true)).With(new LoggingInterceptor()); }
public void Install(IKernel kernel) { kernel.Bind <ICommandExecutor>().To <CommandExecutor>(); kernel.Bind(c => c.FromAssemblyContaining <IArtistRepository>(). SelectAllClasses().InheritedFrom(typeof(IHandleCommand <>)) .BindAllInterfaces()); kernel.Intercept(InterceptSetup).With <SessionAndTransactionWrapper>(); }
private void AddBllBindings() { _ninjectKernel.Bind <IProductService>().To <ProductManager>().WithConstructorArgument("productDal", new EfProductDal()); //senden IProductService istenirse o kişiye ProductManager'i ver dedik _ninjectKernel.Bind <ICategoryService>().To <CategoryManager>().WithConstructorArgument("categoryDal", new EfCategoryDal()); //senden ICategoryService istenirse o kişiye ProductManager'i ver dedik _ninjectKernel.Bind <IAuthenticationService>().To <AuthenticationManager>().WithConstructorArgument("authenticationDal", new EfAuthenticationDal()); _ninjectKernel.Intercept(p => (true)).With(new LoggingInterceptor()); }
public void Install(IKernel kernel) { kernel.Bind<ICommandExecutor>().To<CommandExecutor>(); kernel.Bind(c => c.FromAssemblyContaining<IArtistRepository>(). SelectAllClasses().InheritedFrom(typeof(IHandleCommand<>)) .BindAllInterfaces()); kernel.Intercept(InterceptSetup).With<SessionAndTransactionWrapper>(); }
//controlarda verinin ne dondugnnu anlamak için private void AddBllBindings() { _ninjectKernel.Bind <IProductService>().To <ProductManager>().WithConstructorArgument("productDal", new EfProductDal()); _ninjectKernel.Bind <ICategoryService>().To <CategoryManager>().WithConstructorArgument("categoryDal", new EfCategoryDal()); _ninjectKernel.Bind <IAuthenticationService>().To <AuthanticationManager>().WithConstructorArgument("authenticationDal", new EfAuthenticationDal()); //loglama uygulamak ıcın //nuget oaketden extension interceptionu eklıyoruz //tum actionlara log lama uygula _ninjectKernel.Intercept(p => (true)).With(new LoggingInterceptor()); }
/// <summary> /// Indicates that matching interface binding types should be intercepted via the trace interceptor. /// The interceptor will be created via the kernel when the method is called. /// </summary> /// <param name="kernel">Ninject kernel</param> /// <param name="types">Types of interface</param> /// <returns>The advice order builder.</returns> public static void TraceInterfaceBindings(this IKernel kernel, params Type[] types) { kernel.Intercept(context => context.Request.Service.IsInterface && types.Contains(context.Request.Service)).With <TraceInterceptor>().InOrder(0); }
/// <summary> /// Indicates that all interface bindings should be intercepted via the trace interceptor. /// The interceptor will be created via the kernel when the method is called. /// </summary> /// /// <param name="kernel">Ninject kernel</param> public static void TraceInterfaceBindings(this IKernel kernel) { kernel.Intercept(context => context.Request.Service.IsInterface).With <TraceInterceptor>().InOrder(0); }