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

C# IManyToOneInstance类代码示例

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

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



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

示例1: Apply

        public void Apply(IManyToOneInstance instance)
        {
            string entity = instance.EntityType.Name;
            string member = instance.Property.Name;

            instance.ForeignKey($"FK_{entity}_{member}");
        }
开发者ID:devworker55,项目名称:Mammatus,代码行数:7,代码来源:ForeignKeyConstraintNames.cs


示例2: Apply

 public void Apply(IManyToOneInstance instance)
 {
     if (instance.Property.MemberInfo.IsDefined(typeof(RequiredAttribute), false))
         instance.Not.Nullable();
     else
         instance.Nullable();
 }
开发者ID:Ridermansb,项目名称:GenerateIdDesignerProblem,代码行数:7,代码来源:NullablesConvention.cs


示例3: Apply

        public void Apply(IManyToOneInstance instance)
        {
            instance.ForeignKey(string.Format("FK_{0}_{1}",
                   instance.Name, instance.EntityType.Name));


        }
开发者ID:GersonDias,项目名称:studies,代码行数:7,代码来源:NhibernateConvention.cs


示例4: Apply

 public void Apply(IManyToOneInstance instance)
 {
     var type = instance.EntityType;
     var member = instance.Property;
     var columnName = GetConstraintName(type.Name, member.Name);
     instance.ForeignKey(columnName);
 }
开发者ID:neteagles,项目名称:Komrad.Template,代码行数:7,代码来源:ForeignKeyConstraintNameConvention.cs


示例5: Apply

 public void Apply(IManyToOneInstance instance)
 {
     if (!IsNotNull(instance))
         return;
     instance.Not.Nullable();
     instance.NotFound.Exception();
 }
开发者ID:Eskat0n,项目名称:Frameplate,代码行数:7,代码来源:NotNullPropertyConvention.cs


示例6: Apply

        public void Apply(IManyToOneInstance instance)
        {
            if (Attribute.IsDefined(instance.Property.MemberInfo, typeof(RequiredAttribute)))
                instance.Not.Nullable();

            instance.ForeignKey(string.Format("FK_{0}_{1}_{2}", instance.EntityType.Name, instance.Class.Name, instance.Property.Name));
        }
开发者ID:rjonker1,项目名称:lightstone-data-platform,代码行数:7,代码来源:ReferenceConvention.cs


示例7: Apply

        public void Apply(IManyToOneInstance instance)
        {
            string entity = instance.EntityType.Name;
            string member = instance.Property.Name;

            instance.ForeignKey(string.Format("FK_{0}_{1}", entity, member));
        }
开发者ID:llenroc,项目名称:Inflexion2,代码行数:7,代码来源:ForeignKeyConstraintNames.cs


示例8: Apply

 public void Apply(IManyToOneInstance instance)
 {
     instance.Column(instance.Property.Name + "ID");
     instance.ForeignKey(string.Format("FK_{0}_{1}_{2}",
                                       instance.EntityType.Name + "s",
                                       instance.Property.Name + "s",
                                       instance.Property.Name + "ID"));
 }
开发者ID:ot-nara-alzapur,项目名称:Test-Case-Tracker,代码行数:8,代码来源:ReferenceConvention.cs


示例9: Apply

        public void Apply(IManyToOneInstance instance)
        {
            var foreignKeyName = string.Format("FK__{0}_{1}__{2}", instance.EntityType.Name, instance.Name, instance.Class.Name);

            instance.ForeignKey(foreignKeyName);
            instance.Column(instance.Name + "Id");
            instance.Not.Nullable();
        }
开发者ID:dwdkls,项目名称:pizzamvc,代码行数:8,代码来源:ReferenceConvention.cs


示例10: Apply

 public void Apply(IManyToOneInstance instance)
 {
     instance.Column(instance.Property.Name + ConventionConstants.Id);
     instance.ForeignKey(string.Format("FK_{0}_{1}_{2}",
                                       instance.EntityType.Name + ConventionConstants.TableSuffix,
                                       instance.Property.Name + ConventionConstants.TableSuffix,
                                       instance.Property.Name + ConventionConstants.Id));
 }
开发者ID:rexwhitten,项目名称:Siege,代码行数:8,代码来源:ReferenceConvention.cs


示例11: Apply

 public void Apply(IManyToOneInstance instance)
 {
     if (!instance.Property.PropertyType.IsInterface)
     {
         instance.Column(instance.Property.PropertyType.Name + "Id");
     }
     instance.ForeignKey(instance.EntityType.Name + "_" + instance.Property.Name + "_FK");
 }
开发者ID:vincentzh,项目名称:BeautySalonManagement,代码行数:8,代码来源:ReferenceConvention.cs


示例12: Apply

 public void Apply(IManyToOneInstance instance)
 {
     var meta = QueryFluentMetadata.FindMetadataFor(instance.EntityType, instance.Property.Name);
     if (meta != null && meta.Required.HasValue && meta.Required.Value)
     {
         instance.Not.Nullable();
     }
 }
开发者ID:forger,项目名称:FluentMetadata,代码行数:8,代码来源:FluentMetaDataConvention.cs


示例13: Apply

		public void Apply(IManyToOneInstance instance)
		{
			var abbreviation = AttributeHelper.GetTypeAttribute<AbbreviationAttribute>(instance.Property.PropertyType);
			var prefix = abbreviation == null
				? instance.Property.PropertyType.Name
				: abbreviation.Abbreviation;
			instance.Column((prefix + "Id").EscapeColumnName());
		}
开发者ID:seatwave,项目名称:Quarks,代码行数:8,代码来源:Column.cs


示例14: Apply

        /// <summary>
        /// Applies this reference convention to the specified <see cref = "IManyToOneInstance" />.
        /// </summary>
        /// <param name="instance">An <see cref = "IManyToOneInstance" />.</param>
        public void Apply(IManyToOneInstance instance)
        {
            if (instance == null)
            {
                throw new ArgumentNullException("instance");
            }

            instance.Column(instance.Property.Name + "Id");
        }
开发者ID:MatthewRudolph,项目名称:Airy,代码行数:13,代码来源:ReferenceConvention.cs


示例15: Apply

        /// <summary>
        /// Applies Foriegn key based on type.
        /// </summary>
        /// <param name="instance">The instance.</param>
        public void Apply( IManyToOneInstance instance )
        {
            var referenceName = instance.GetReferenceName ().Replace ( "`1", string.Empty );

            // Name the foreign key constraint
            var foreignKeyName = string.Format ( "{0}_FK", referenceName );

            instance.ForeignKey ( foreignKeyName );
        }
开发者ID:divyang4481,项目名称:REM,代码行数:13,代码来源:ForeignKeyConvention.cs


示例16: Apply

        /// <summary>
        /// The convention that is applied to a <see cref = "IPropertyInstance" /> when the criteria from the Accept method is meet.
        /// </summary>
        /// <param name="instance">An <see cref = "IPropertyInstance" /> to apply the convention to.</param>
        public void Apply(IManyToOneInstance instance)
        {
            if (instance == null)
            {
                throw new ArgumentNullException("instance");
            }

            instance.Not.Nullable();
        }
开发者ID:MatthewRudolph,项目名称:Airy,代码行数:13,代码来源:RequiredReferenceConvention.cs


示例17: Apply

 public void Apply(IManyToOneInstance instance)
 {
     instance.Cascade.All();
     instance.Not.Nullable();
     instance.Column(NamingHelper.GetPrefixedName(instance.Property.PropertyType) + "_id");
     instance.ForeignKey(string.Format("fk_{0}_{1}",
         Inflector.Underscore(instance.Property.PropertyType.Name),
         NamingHelper.GetPrefixedName(instance.EntityType)));
 }
开发者ID:brendanhay,项目名称:Shared,代码行数:9,代码来源:ReferencesConvention.cs


示例18: Apply

        public void Apply(IManyToOneInstance instance)
        {
            var attr = instance.Property.PropertyType.GetCustomAttribute<TableNameAttribute>();

            if (instance.Property.MemberInfo.IsDefined(typeof (NotNullAttribute), false))
                instance.Not.Nullable();

            var columnName = string.Format("{0}Id", (attr != null ? attr.TableName : instance.Property.PropertyType.Name));
            instance.Column(columnName);
        }
开发者ID:evgenyk,项目名称:Brick.FluentNHibernate.Conventions,代码行数:10,代码来源:ManyToOneConvention.cs


示例19: Apply

        /// <summary>
        /// Apply changes to the target
        /// </summary>
        public void Apply(IManyToOneInstance instance)
        {
            Type inferredType = instance.Class.GetUnderlyingSystemType();
            Type persistentType = _mapProxyInterfaceTypeToPersistentType(inferredType);

            if (persistentType != null)
            {
                instance.OverrideInferredClass(persistentType);
            }
        }
开发者ID:nsreddy1986,项目名称:fluent-nhibernate,代码行数:13,代码来源:ProxyConvention.cs


示例20: Apply

        /// <summary>
        /// Applies Foriegn key column name based on type.
        /// </summary>
        /// <param name="instance">The instance.</param>
        public void Apply( IManyToOneInstance instance )
        {
            // name the key field
            var key = instance.Property.Name;

            if ( typeof( ILookup ).IsAssignableFrom ( instance.Property.PropertyType ) )
            {
                key = key + "Lkp";
            }

            instance.Column ( key + "Key" );
        }
开发者ID:divyang4481,项目名称:REM,代码行数:16,代码来源:ForeignKeyColumnNameConvention.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IMap类代码示例发布时间:2022-05-24
下一篇:
C# IManufacturerService类代码示例发布时间: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