Skip to content

Instantly share code, notes, and snippets.

@MongkonEiadon
Created April 4, 2017 07:37
Show Gist options
  • Save MongkonEiadon/5c3822456cbea3e13db2b3415c9c656f to your computer and use it in GitHub Desktop.
Save MongkonEiadon/5c3822456cbea3e13db2b3415c9c656f to your computer and use it in GitHub Desktop.
Register the reader and the configuration models
public class AppSettingModule : Autofac.Module {
protected override void Load(ContainerBuilder builder) {
builder.RegisterType<ConfigurationReader>().As<IConfigurationReader>().SingleInstance();
builder.Register(c => c.Resolve<IConfigurationReader>().Load<BotConfiguration>()).As<IBotConfiguration>();
// Register future model here...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment