public GenericBaseRepository(IConfiguration _config) { this._config = _config; SqlMapper.SetTypeMap(typeof(CoffeeShop), MappingConfigurator.CreateMap(typeof(CoffeeShop))); SqlMapper.SetTypeMap(typeof(Image), MappingConfigurator.CreateMap(typeof(Image))); SqlMapper.SetTypeMap(typeof(Event), MappingConfigurator.CreateMap(typeof(Event))); SqlMapper.SetTypeMap(typeof(Bean), MappingConfigurator.CreateMap(typeof(Bean))); SqlMapper.SetTypeMap(typeof(Blend), MappingConfigurator.CreateMap(typeof(Blend))); SqlMapper.SetTypeMap(typeof(BusStation), MappingConfigurator.CreateMap(typeof(BusStation), MappingConfigurator.BusStationMapper)); SqlMapper.SetTypeMap(typeof(CoffeeDrink), MappingConfigurator.CreateMap(typeof(CoffeeDrink))); SqlMapper.SetTypeMap(typeof(Equipment), MappingConfigurator.CreateMap(typeof(Equipment))); //TODO SqlMapper.SetTypeMap(typeof(EquipmentCategory), MappingConfigurator.CreateMap(typeof(EquipmentCategory))); SqlMapper.SetTypeMap(typeof(Location), MappingConfigurator.CreateMap(typeof(Location))); //TODO SqlMapper.SetTypeMap(typeof(OpeningTime), MappingConfigurator.CreateMap(typeof(OpeningTime))); SqlMapper.SetTypeMap(typeof(Poi), MappingConfigurator.CreateMap(typeof(Poi))); SqlMapper.SetTypeMap(typeof(Preparation), MappingConfigurator.CreateMap(typeof(Preparation))); SqlMapper.SetTypeMap(typeof(CoffeeShopPreview), MappingConfigurator.CreateMap(typeof(CoffeeShopPreview), MappingConfigurator.CoffeeShopPreviewMapper)); SqlMapper.SetTypeMap(typeof(Event), MappingConfigurator.CreateMap(typeof(Event), MappingConfigurator.EventMapper)); SqlMapper.SetTypeMap(typeof(EventViewModel), MappingConfigurator.CreateMap(typeof(EventViewModel), MappingConfigurator.EventMapper)); SqlMapper.SetTypeMap(typeof(Company), MappingConfigurator.CreateMap(typeof(Company), MappingConfigurator.CompanyMapper)); NpgsqlConnection.GlobalTypeMapper.MapComposite <Address>("address"); }
public DatabaseFactory(IDatabaseConfigurationProvider configuration, MappingConfigurator mappingConfigurator) { this.configuration = configuration; this.mappingConfigurator = mappingConfigurator; this.mappingConfigurator.ConfigureMapping(); this.mongoClient = CreateClient(); }
public ResumePointRepository(IMongoDatabase database, MappingConfigurator mappingConfigurator) { this.database = database; this.mappingConfigurator = mappingConfigurator; this.pointCollection = this.database.GetCollection <ResumePoint>("resumePoints"); accountIdColumnName = this.mappingConfigurator.MapNameToMongo(nameof(ResumePoint.AccountId)); videoIdColumnName = this.mappingConfigurator.MapNameToMongo(nameof(ResumePoint.VideoId)); timePointColumnName = this.mappingConfigurator.MapNameToMongo(nameof(ResumePoint.TimePoint)); EnsureIndexCreated(); }
protected void Initialize() { Nails.Configure() .IoC.Container <NailsFramework.IoC.Spring>() .Persistence.DataMapper <NailsFramework.Persistence.NHibernate>( x => x.Configure(c => MappingConfigurator.Configure(c))) .UserInterface.Platform <NullUIPlatform>() .Logging.Logger <NullLogger>() .InspectAssembly(@"Encuentrame.Model.dll") .InspectAssembly(@"Encuentrame.Support.Mappings.dll") .InspectAssembly(@"Encuentrame.Model.Mappings.dll") .InspectAssembly(@"Encuentrame.Support.Email.dll") .InspectAssembly(@"Encuentrame.InfoUpdaterService.exe") .Initialize(); Thread.Sleep(3000); }
protected override void ConfigureNails(INailsConfigurator nails) { nails.IoC.Container <NailsFramework.IoC.Spring>() .Persistence.DataMapper <NailsFramework.Persistence.NHibernate>( x => x.Configure(c => MappingConfigurator.Configure(c))) .UserInterface.Platform <Mvc>() .Logging.Logger <Log4net>() .InspectAssembly(@"bin\Encuentrame.Model.dll") .InspectAssembly(@"bin\Encuentrame.Support.Mappings.dll") .InspectAssembly(@"bin\Encuentrame.Model.Mappings.dll") .InspectAssembly(@"bin\Encuentrame.Security.dll") .InspectAssembly(@"bin\Encuentrame.Web.dll") .InspectAssembly(@"bin\Encuentrame.Support.Email.dll") .InspectAssembly(@"bin\Encuentrame.Support.ExpoNotification.dll") .Aspects .ApplyBehavior <LogBehavior>().ToInheritorsOf(typeof(ControllerBase)) .ApplyBehavior <AuditBehavior>().ToMethodsWithAttribute <AuditAttribute>() .IoC.Lemming <DomainAuthenticationProvider>() .IoC.Lemming <AuthenticationDataProvider>() .IoC.Lemming <TranslationService>(); }
public static void AssemblyInit(TestContext context) { NailsTestsConfigurationRepository.Instance.Set("BaseTestConfiguration", (nails) => { nails .IoC.Container <NailsFramework.IoC.Spring>() .Persistence.DataMapper <NailsFramework.Persistence.NHibernate>( x => x.Configure(c => MappingConfigurator.Configure(c))) .UserInterface.Platform <NullUIPlatform>() .Logging.Logger <Log4net>() .InspectAssembly(@"Encuentrame.Model.dll") .InspectAssembly(@"Encuentrame.Support.Mappings.dll") .InspectAssembly(@"Encuentrame.Model.Mappings.dll") .InspectAssembly(@"Encuentrame.Tests.Supports.dll") .InspectAssembly(@"Encuentrame.Tests.dll") .InspectAssembly(@"Encuentrame.Support.Email.dll") .IoC.Lemming <DomainAuthenticationProvider>() .Lemming <AuthenticationDataProvider>() .Lemming <TranslationService>() .Initialize(); }); }
public Startup(IConfiguration configuration) { Configuration = configuration; MappingConfigurator.Configure(); }
public static void ConfigureMapper(IMapperConfigurationExpression expression) => MappingConfigurator.Configure(expression);