Exemplo n.º 1
0
 protected IPersistenceProvider GetProvider(Mapping mapping)
 {
     SqlMapperProvider engine = new SqlMapperProvider();
     engine.Mapping = mapping;
     engine.RegisterMetaData(Evaluant.Uss.MetaData.MetaDataFactory.FromAssembly(Assembly.GetExecutingAssembly(), Namespace));
     engine.ConnectionString = ConfigurationManager.ConnectionStrings["SqlMapper.SqlServer"].ConnectionString;
     return engine;
 }
Exemplo n.º 2
0
        public override void ShouldLoadMappingFile()
        {
            Mapping mapping = Mapping.Load(Path.Combine(mappingFolder, "SingleEntity/mapping.xml"));

            SqlMapperProvider engine = new SqlMapperProvider();
            engine.Mapping = mapping;
            engine.RegisterMetaData(Evaluant.Uss.MetaData.MetaDataFactory.FromAssembly(Assembly.GetExecutingAssembly(), "SingleEntity"));
            engine.ConnectionString = ConfigurationManager.ConnectionStrings["SqlMapper.SqlServer"].ConnectionString;
            engine.CreatePersistenceEngine().InitializeRepository();

            engine.CreatePersistenceEngine().Load(new NLinqQuery(
                @"  from SingleEntity.Person p in context
                    where p.FirstName == 'toto'
                    select p"
            ));

        }