Wednesday, November 7, 2012
Sunday, September 23, 2012
Entice Me
Opening my eyes and looking around to see what is available. Willing to relocate for the right opportunity or area (I like the coast). I bring a great deal to the table and I'm kinda fun to work with...let's see what we can do for each other.
Curriculum Vitae/Resume
Zerply-Profile
Opening my eyes and looking around to see what is available. Willing to relocate for the right opportunity or area (I like the coast). I bring a great deal to the table and I'm kinda fun to work with...let's see what we can do for each other.
Curriculum Vitae/Resume
Zerply-Profile
Friday, June 8, 2012
Ninject + MVC 4
Nothing earth shattering here - but was wrestling with current WCF services and trying to leverage the delicious newness of the WebApi with Ninject 3.0. A bit of pain and a few tears later...
1: public class MvcApplication : NinjectHttpApplication
2: {
3: /// <summary>
4: /// Called when [application started].
5: /// </summary>
6: protected override void OnApplicationStarted()
7: {
8: base.OnApplicationStarted();
9:
10: AreaRegistration.RegisterAllAreas();
11: FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
12: RouteConfig.RegisterRoutes(RouteTable.Routes);
13: BundleConfig.RegisterBundles(BundleTable.Bundles);
14: }
15:
16: /// <summary>
17: /// Creates the kernel.
18: /// </summary>
19: /// <returns>IoC container object</returns>
20: protected override IKernel CreateKernel()
21: {
22: IKernel kernel = new StandardKernel(new NinjectSettings { LoadExtensions = true });
23:
24: // add AutoMapper to the core -> needs to be first; as services will use this.
25: kernel.Bind<ITypeMapFactory>().To<TypeMapFactory>();
26: kernel.Bind<ConfigurationStore>().ToConstant(new ConfigurationStore(kernel.Get<ITypeMapFactory>(), MapperRegistry.AllMappers())).InSingletonScope();
27: kernel.Bind<IConfiguration>().ToMethod(c => c.Kernel.Get<ConfigurationStore>());
28: kernel.Bind<IConfigurationProvider>().ToMethod(c => c.Kernel.Get<ConfigurationStore>());
29: kernel.Bind<IMappingEngine>().To<MappingEngine>();
30:
31: kernel.Bind(
32: x =>
33: x.FromAssembliesMatching(new[]
34: {
35: "*.Service.dll", "*.Service.Mvc.dll", "*.Service.Data.dll"
36: }).SelectAllClasses().BindAllInterfaces());
37: kernel.Bind<ServiceHost>().To<NinjectServiceHost>();
38:
39: // not intended to be used when deriving from NinjectHttpApplication <sigh>
40: ////kernel.Bind<IHttpModule>().To<HttpApplicationInitializationHttpModule>();
41: ServiceLocator.SetLocatorProvider(() => new NinjectServiceLocator(kernel));
42: var locator = new NinjectServiceLocator(kernel);
43: ServiceLocator.SetLocatorProvider(() => locator);
44: return kernel;
45: }
46: }
Friday, April 13, 2012
Well - its been awhile. I've been mostly tweeting and/or G+ Anyway, new look. New trends. Job Trends 2012
Subscribe to:
Posts (Atom)