public WsMetadataGenerator() { var kernel = new StandardKernel(); kernel.Bind<JsonMapperManager>().ToSelf().InSingletonScope().OnActivation(JsonMapperConfig.ConfigureMapping); kernel.Bind<DataContext>().ToSelf().InSingletonScope() .OnActivation<DataContext>(context => { context.SetRepositoryCreator(type => kernel.Get(type)); }); _dataXmlCommentReader = new XmlCommentReader("DeviceHive.Data.xml"); _wsXmlCommentReader = new XmlCommentReader("DeviceHive.WebSockets.API.xml"); _helper = new GeneratorHelper(kernel.Get<JsonMapperManager>(), _dataXmlCommentReader); }
public MetadataGenerator() { var kernel = new StandardKernel(); kernel.Bind <JsonMapperManager>().ToSelf().InSingletonScope().OnActivation(JsonMapperConfig.ConfigureMapping); kernel.Bind <DataContext>().ToSelf().InSingletonScope() .OnActivation <DataContext>(context => { context.SetRepositoryCreator(type => kernel.Get(type)); }); _dataXmlCommentReader = new XmlCommentReader("DeviceHive.Data.xml"); _apiXmlCommentReader = new XmlCommentReader("DeviceHive.API.xml"); _helper = new GeneratorHelper(kernel.Get <JsonMapperManager>(), _dataXmlCommentReader); }