• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# MappingInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中MappingInfo的典型用法代码示例。如果您正苦于以下问题:C# MappingInfo类的具体用法?C# MappingInfo怎么用?C# MappingInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MappingInfo类属于命名空间,在下文中一共展示了MappingInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: FluentFor

 /// <summary>
 /// 인자에 맞는 <see cref="UnitOfWorkTestContext"/>의 인스턴스를 빌드한다.
 /// </summary>
 /// <param name="containerConfigPath">IoC 환경설정 파일경로</param>
 /// <param name="dbStrategy">테스트용 DB 생성 전략</param>
 /// <param name="mappingInfo">NHibernate용 Entity 정보</param>
 /// <returns>테스트용 UnitOfWork</returns>
 /// <param name="configAction">추가 환경설정 작업용 델리게이트</param>
 /// <param name="conventions">명명규칙</param>
 public static UnitOfWorkTestContext FluentFor(string containerConfigPath,
                                               UnitOfWorkTestContextDbStrategy dbStrategy,
                                               MappingInfo mappingInfo,
                                               Action<NHibernate.Cfg.Configuration> configAction,
                                               params IConvention[] conventions) {
     return new FluentNHUnitOfWorkTestContext(dbStrategy, containerConfigPath, mappingInfo, configAction, conventions);
 }
开发者ID:debop,项目名称:NFramework,代码行数:16,代码来源:UnitOfWorkTestContext.cs


示例2: ARUnitOfWorkTestContext

 public ARUnitOfWorkTestContext(
     UnitOfWorkTestContextDbStrategy dbStrategy,
     string rhinoContainerConfigPath,
     MappingInfo assemblies)
     : base(dbStrategy, rhinoContainerConfigPath, assemblies)
 {
 }
开发者ID:JackWangCUMT,项目名称:rhino-tools,代码行数:7,代码来源:ARUnitOfWorkTestContext.cs


示例3: CreateFolder

        public static bool CreateFolder(MappingInfo mapping, string title, string tcmContainer)
        {
            if (!EnsureValidClient(mapping))
                return false;

            try
            {
                FolderData folderData = new FolderData
                {
                    Title = title,
                    LocationInfo = new LocationInfo { OrganizationalItem = new LinkToOrganizationalItemData { IdRef = tcmContainer } },
                    Id = "tcm:0-0-0"
                };

                folderData = Client.Save(folderData, new ReadOptions()) as FolderData;
                if (folderData == null)
                    return false;

                return true;
            }
            catch (Exception)
            {
                return false;
            }
        }
开发者ID:mvlasenko,项目名称:TridionVSRazorExtension,代码行数:25,代码来源:MainService.cs


示例4: For

 /// <summary>
 /// 인자에 맞는 <see cref="UnitOfWorkTestContext"/>의 인스턴스를 빌드한다.
 /// </summary>
 /// <param name="container">Container</param>
 /// <param name="dbStrategy">테스트용 DB 생성 전략</param>
 /// <param name="mappingInfo">NHibernate용 Entity 정보</param>
 /// <param name="configAction">추가 환경설정 작업용 델리게이트</param>
 /// <returns>테스트용 UnitOfWork</returns>
 public static UnitOfWorkTestContext For(IWindsorContainer container,
                                         UnitOfWorkTestContextDbStrategy dbStrategy,
                                         MappingInfo mappingInfo,
                                         Action<NHibernate.Cfg.Configuration> configAction) {
     var context = For(string.Empty, dbStrategy, mappingInfo, configAction);
     context._container = container;
     return context;
 }
开发者ID:debop,项目名称:NFramework,代码行数:16,代码来源:UnitOfWorkTestContext.cs


示例5: FluentNHUnitOfWorkTestContext

 public FluentNHUnitOfWorkTestContext(UnitOfWorkTestContextDbStrategy dbStrategy,
                                      string windsorConfigPath,
                                      MappingInfo mappingInfo,
                                      Action<Configuration> configAction,
                                      params IConvention[] conventions)
     : base(dbStrategy, windsorConfigPath, mappingInfo, configAction) {
     _conventions = conventions;
 }
开发者ID:debop,项目名称:NFramework,代码行数:8,代码来源:FluentNHUnitOfWorkTestContext.cs


示例6: InitializeNHibernateAndIoC

 /// <summary>
 /// Initialize the persistence framework, build a session factory, and
 /// initialize the container. If <paramref name="rhinoContainerConfig"/>
 /// is <see langword="null" /> or <see cref="string.Empty">string.Empty</see>
 ///  a <see cref="RhinoContainer">RhinoContainer</see> will not be initialized.
 /// </summary>
 /// <param name="framework">The persistence framework</param>
 /// <param name="rhinoContainerConfig">The configuration file to initialize a 
 /// <see cref="RhinoContainer">RhinoContainer</see> or <see langword="null" />.</param>
 /// <param name="databaseName">Name of the database or <see langword="null" />.</param>
 /// <param name="databaseEngine">The database engine that tests should be performed against</param>
 /// <param name="mappingInfo">Information used to map classes to database tables and queries.</param>
 /// <remarks>
 /// If <paramref name="databaseName"/> is <see langword="null" /> or
 /// <see cref="string.Empty"/> a database with a name
 /// derived from the other parameters supplied will be created. See
 /// <see cref="NHibernateInitializer.DeriveDatabaseNameFrom(Assembly)"/> and <see cref="NHibernateInitializer.DeriveDatabaseNameFrom(DatabaseEngine, Assembly)"/>
 /// </remarks>
 public static void InitializeNHibernateAndIoC(PersistenceFramework framework,
                                               string rhinoContainerConfig,
                                               DatabaseEngine databaseEngine,
                                               string databaseName,
                                               MappingInfo mappingInfo)
 {
     NHibernateInitializer.Initialize(framework, mappingInfo).Using(databaseEngine, databaseName).AndIoC(
         rhinoContainerConfig);
 }
开发者ID:Dreameris,项目名称:.NET-Common-Library,代码行数:27,代码来源:DatabaseTestFixtureBase.cs


示例7: For

		public static UnitOfWorkTestContext For(PersistenceFramework framwork,
                                                IWindsorContainer container,
                                                UnitOfWorkTestContextDbStrategy dbStrategy,
                                                MappingInfo mappingInfo)
		{
			UnitOfWorkTestContext context = For(framwork, string.Empty, dbStrategy, mappingInfo);
			context.rhinoContainer = container;
			return context;
		}
开发者ID:Dreameris,项目名称:.NET-Common-Library,代码行数:9,代码来源:UnitOfWorkTestContext.cs


示例8: InitializeNHibernateAndIoC

 /// <summary>
 /// NHibernate 용 Domain을 테스트하기 위해, 환경을 초기화합니다.
 /// </summary>
 /// <param name="containerConfigPath">Castle Windsor configuration file path</param>
 /// <param name="databaseEngine">Database 종류</param>
 /// <param name="databaseName">Database name</param>
 /// <param name="mappingInfo">Domain Model의 Mapping information</param>
 /// <param name="configAction">configuration 부가 작업</param>
 public static void InitializeNHibernateAndIoC(string containerConfigPath,
                                               DatabaseEngine databaseEngine,
                                               string databaseName,
                                               MappingInfo mappingInfo,
                                               Action<NHibernate.Cfg.Configuration> configAction) {
     NHibernateInitializer.Initialize(mappingInfo, configAction)
         .Using(databaseEngine, databaseName)
         .AndIoC(containerConfigPath);
 }
开发者ID:debop,项目名称:NFramework,代码行数:17,代码来源:DatabaseTestFixtureBase.cs


示例9: MappingStrategy

 public MappingStrategy(MappingInfo mappingInfo)
 {
     Source = mappingInfo.MappingSourceType;
     Target = mappingInfo.MappingTargetType;
     HasTargetInstance = mappingInfo.MapIntoExistingTargetInstance;
     ContextExpression = Expression.Parameter(typeof (MappingContext), "context");
     SourceExpression = Expression.Variable(Source, "source");
     TargetExpression = Expression.Variable(Target, "target");
     MapperExpression = Expression.Property(ContextExpression, MappingContextMeta.Mapper);
 }
开发者ID:runerei,项目名称:Cartographer,代码行数:10,代码来源:MappingStrategy.cs


示例10: BuildInsertColumns

 public override StringBuilder BuildInsertColumns(MappingInfo.IObjectMapInfo map, object entity)
 {
     StringBuilder b = new StringBuilder();
     foreach (var pmi in map.PropertyMaps)
     {
         b.Append(_tr.GetEscapedColumnName(pmi.ColumnName)).Append(_tr.ColumnDelimiter);
     }
     b.RemoveEnd(_tr.ColumnDelimiter);
     return b;
 }
开发者ID:rexzh,项目名称:RexToy,代码行数:10,代码来源:MappingColumnsBuilder.cs


示例11: BuildInsertValues

        public override StringBuilder BuildInsertValues(MappingInfo.IObjectMapInfo map, object entity)
        {
            StringBuilder b = new StringBuilder();
            IReflector r = Reflector.Bind(entity);
            foreach (var pmi in map.PropertyMaps)
            {
                if (map.PrimaryKeyGenerate == PrimaryKeyGenerate.Customized && map.PrimaryKeyMaps.Contains(pmi))
                {
                    string sequenceName = map.PKGenerateString.RemoveBegin(ConstantString.SEQ_Prefix);
                    b.Append(sequenceName).Append(_tr.MemberAccess).Append(ConstantString.SEQ_NextVal).Append(_tr.ColumnDelimiter);
                    continue;
                }

                b.Append(_tr.GetValueString(r.GetPropertyValue(pmi.PropertyName))).Append(_tr.ColumnDelimiter);
            }
            b.RemoveEnd(_tr.ColumnDelimiter);
            return b;
        }
开发者ID:rexzh,项目名称:RexToy,代码行数:18,代码来源:MappingColumnsBuilder.cs


示例12: MappingStrategy

        public MappingStrategy(MappingInfo mappingInfo, IMappingDescriptor descriptor)
        {
            Descriptor = descriptor;
            Source = mappingInfo.MappingSourceType;
            Target = mappingInfo.MappingTargetType;
            HasTargetInstance = mappingInfo.MapIntoExistingTargetInstance;
            try
            {
                TargetConstructor = Target.GetConstructors().Single();
                ConstructorParameterMappingSteps = new OrderedKeyedCollection<ParameterInfo, MappingStep>(TargetConstructor.GetParameters());
            }
            catch (InvalidOperationException)
            {
                throw new ArgumentException("Target type must have single public constructor. This is the only scenario supported at the moment.", "target");
            }

            ContextExpression = Expression.Parameter(typeof (MappingContext), "context");
            SourceExpression = Expression.Variable(Source, "source");
            TargetExpression = Expression.Variable(Target, "target");
            MapperExpression = Expression.Property(ContextExpression, MappingContextMeta.Mapper);
        }
开发者ID:olcayseker,项目名称:Cartographer,代码行数:21,代码来源:MappingStrategy.cs


示例13: BuildMappingStrategy

        public MappingStrategy BuildMappingStrategy(MappingInfo mappingInfo)
        {
            var strategy = new MappingStrategy(mappingInfo, descriptor);

            //first try to shortcircuit
            var directMappingStep = new DirectMappingStep(strategy.Source, strategy.Target);
            var converter = ApplyConverter(directMappingStep, withFallback: false);
            if (converter != null)
            {
                directMappingStep.Conversion = converter;
                strategy.InitTargetStep = directMappingStep;
                return strategy;
            }
            foreach (var pattern in mappingPatterns)
            {
                pattern.Contribute(strategy);
            }
            foreach (var mappingStep in strategy.MappingSteps)
            {
                mappingStep.Conversion = ApplyConverter(mappingStep, withFallback: true);
            }
            if (strategy.HasTargetInstance)
            {
                strategy.InitTargetStep = new SimpleStep(strategy.Target, strategy.Target, (s, _) => Expression.Convert(Expression.Property(s.ContextExpression, MappingContextMeta.TargetInstance), s.Target));
            }
            else
            {
                foreach (var mappingStep in strategy.ConstructorParameterMappingSteps.ByKey)
                {
                    if (mappingStep.Value == null)
                    {
                        throw new InvalidOperationException(string.Format("No mapping for constructor parameter {0} has been specified. All constructor parameters need value", mappingStep.Key));
                    }
                    mappingStep.Value.Conversion = ApplyConverter(mappingStep.Value, withFallback: true);
                }
                strategy.InitTargetStep = new SimpleStep(strategy.Target, strategy.Target, (s, _) => Expression.New(s.TargetConstructor, GetConstructorParameters(s)));
            }
            return strategy;
        }
开发者ID:olcayseker,项目名称:Cartographer,代码行数:39,代码来源:MappingStrategyBuilder.cs


示例14: GetTcpClient

 public static LocalSessionAwareCoreServiceClient GetTcpClient(MappingInfo mapping)
 {
     EnsureCredentialsNotEmpty(mapping);
     return GetTcpClient(mapping.Host, mapping.Username, mapping.Password);
 }
开发者ID:mvlasenko,项目名称:TridionVSRazorExtension,代码行数:5,代码来源:MainService.cs


示例15: NHUnitOfWorkTestContext

 /// <summary>
 /// 생성자
 /// </summary>
 /// <param name="dbStrategy">테스트용 DB 생성 전략</param>
 /// <param name="windsorConfigPath">IoC 환경설정 파일경로</param>
 /// <param name="mappingInfo">NHibernate 매핑 정보</param>
 /// <param name="configAction">Configuration 빌드 시 추가할 사항을 정의한 Action</param>
 public NHUnitOfWorkTestContext(UnitOfWorkTestContextDbStrategy dbStrategy,
                                string windsorConfigPath,
                                MappingInfo mappingInfo,
                                Action<Configuration> configAction)
     : base(dbStrategy, windsorConfigPath, mappingInfo, configAction) {}
开发者ID:debop,项目名称:NFramework,代码行数:12,代码来源:NHUnitOfWorkTestContext.cs


示例16: Initialize

 public static NHibernateInitializer Initialize(PersistenceFramework framework, MappingInfo mappingInfo)
 {
     NHibernateInitializer initializer=new NHibernateInitializer(framework,mappingInfo);
     return initializer;
 }
开发者ID:brumschlag,项目名称:rhino-tools,代码行数:5,代码来源:DatabaseTestFixtureBase.cs


示例17: NHibernateInitializer

 protected internal NHibernateInitializer(PersistenceFramework framework, MappingInfo mappingInfo)
 {
     Guard.Against<ArgumentNullException>(mappingInfo == null, "MappingInfo is required.");
     this.framework = framework;
     this.mappingInfo = mappingInfo;
     ioc=new IoCInitializer(this);
 }
开发者ID:brumschlag,项目名称:rhino-tools,代码行数:7,代码来源:DatabaseTestFixtureBase.cs


示例18: IntializeNHibernateAndIoC

 /// <summary>
 /// See <see cref="IntializeNHibernateAndIoC(PersistenceFramework,string,DatabaseEngine,string,MappingInfo)"/>
 /// </summary>
 public static void IntializeNHibernateAndIoC(PersistenceFramework framework, string rhinoContainerConfig, MappingInfo mappingInfo)
 {
     NHibernateInitializer.Initialize(framework, mappingInfo).AndIoC(rhinoContainerConfig);
 }
开发者ID:brumschlag,项目名称:rhino-tools,代码行数:7,代码来源:DatabaseTestFixtureBase.cs


示例19: IntializeNHibernate

 /// <summary>
 /// See <see cref="IntializeNHibernateAndIoC(PersistenceFramework,string,DatabaseEngine,string,MappingInfo)"/>
 /// </summary>
 public static void IntializeNHibernate(PersistenceFramework framework, MappingInfo mappingInfo)
 {
     NHibernateInitializer.Initialize(framework, mappingInfo);
 }
开发者ID:brumschlag,项目名称:rhino-tools,代码行数:7,代码来源:DatabaseTestFixtureBase.cs


示例20: SetCrawledPropertyMappings

        private void SetCrawledPropertyMappings(
            SPSite site,
            SPManagedPropertyInfo managedPropertyDefinition,
            ManagedPropertyInfo managedPropertyInfo,
            SearchServiceApplication ssa,
            SearchObjectOwner owner,
            List<MappingInfo> mappings)
        {
            // Ensure crawl properties mappings
            foreach (var crawledPropertyKeyAndOrder in managedPropertyInfo.CrawledProperties)
            {
                // Get the crawled property (there may be more than one matching that name)
                var matchingCrawledProperties = this.GetCrawledPropertyByName(site, crawledPropertyKeyAndOrder.Key);
                if (matchingCrawledProperties != null && matchingCrawledProperties.Count > 0)
                {
                    foreach (var crawledProperty in matchingCrawledProperties)
                    {
                        // Create mapping information
                        var mapping = new MappingInfo
                        {
                            CrawledPropertyName = crawledProperty.Name,
                            CrawledPropset = crawledProperty.Propset,
                            ManagedPid = managedPropertyDefinition.Pid,
                            MappingOrder = crawledPropertyKeyAndOrder.Value
                        };

                        // If managed property doesn't already contain a mapping for the crawled property, add it
                        if (
                            ssa.GetManagedPropertyMappings(managedPropertyDefinition, owner)
                                .All(m => m.CrawledPropertyName != mapping.CrawledPropertyName))
                        {
                            mappings.Add(mapping);
                        }
                        else
                        {
                            this.logger.Info(
                                "Mapping for managed property {0} and crawled property with name {1} is already exists",
                                managedPropertyDefinition.Name,
                                crawledPropertyKeyAndOrder);
                        }
                    }
                }
                else
                {
                    this.logger.Warn("Crawled property with name {0} not found!", crawledPropertyKeyAndOrder);
                }
            }

            // Apply mappings to the managed property
            if (mappings.Count > 0)
            {
                ssa.SetManagedPropertyMappings(managedPropertyDefinition, mappings, owner);
            }
        }
开发者ID:andresglx,项目名称:Dynamite,代码行数:54,代码来源:SearchHelper.cs



注:本文中的MappingInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# MappingSchema类代码示例发布时间:2022-05-24
下一篇:
C# MappingEntity类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap