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

C# IIdentityInstance类代码示例

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

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



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

示例1: Apply

 public void Apply(IIdentityInstance instance)
 {
     //规定所有表的主键都是ID
     instance.Column("ID");
     //主键自增
     instance.GeneratedBy.Guid();
 }
开发者ID:vebin,项目名称:BDDD,代码行数:7,代码来源:CustomPrimaryKeyConvention.cs


示例2: Apply

 public void Apply(IIdentityInstance instance)
 {
     instance.CustomType<Guid>();
     instance.Column("Id");
     instance.GeneratedBy.Custom<global::NHibernate.Id.SequenceHiLoGenerator>();
     instance.UnsavedValue(Guid.Empty.ToString());
 }
开发者ID:brucewu16899,项目名称:lacjam,代码行数:7,代码来源:PrimaryKeyConvention.cs


示例3: Apply

        public void Apply(IIdentityInstance instance)
        {
            instance.Column("Id");
            instance.UnsavedValue("0");

            // instance.GeneratedBy.HiLo("1000");
        }
开发者ID:seif,项目名称:Northwind,代码行数:7,代码来源:PrimaryKeyConvention.cs


示例4: Apply

        public void Apply(IIdentityInstance instance)
        {
            var sequenceName = NameConventions.GetSequenceName(instance.EntityType);
            var columnName = NameConventions.GetPrimaryKeyColumnName(instance.EntityType);

            instance.Column(columnName);
            instance.GeneratedBy.Native(paramBuilder => paramBuilder.AddParam("sequence", sequenceName));
        }
开发者ID:Eskat0n,项目名称:Frameplate,代码行数:8,代码来源:PrimaryKeyConvention.cs


示例5: Apply

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

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


示例6: Apply

 public void Apply(IIdentityInstance instance)
 {
     instance.Column("Id");
     if (instance.Type == typeof(int) || instance.Type == typeof(long)) {
         instance.GeneratedBy.Identity();
     } else {
         instance.GeneratedBy.Assigned();
     }
 }
开发者ID:realzhaorong,项目名称:vocadb,代码行数:9,代码来源:ClassConventions.cs


示例7: Apply

		public void Apply(IIdentityInstance instance)
		{
			// Standard identity column name is "Id"
			var abbreviation = AttributeHelper.GetTypeAttribute<AbbreviationAttribute>(instance.EntityType);
			var prefix = abbreviation == null
				? ""
				: abbreviation.Abbreviation;
			instance.Column((prefix + instance.Name).EscapeColumnName());
		}
开发者ID:seatwave,项目名称:Quarks,代码行数:9,代码来源:Column.cs


示例8: Apply

 public void Apply(IIdentityInstance instance)
 {
     if (typeof(ISagaEntity).IsAssignableFrom(instance.EntityType))
     {
         instance.GeneratedBy.Assigned();
     }
     else
         instance.GeneratedBy.GuidComb();
 }
开发者ID:togakangaroo,项目名称:NServiceBus,代码行数:9,代码来源:IdShouldBeAssignedConvention.cs


示例9: Apply

        public void Apply(IIdentityInstance instance)
        {
            var columnName = "Id";

            var idAttribute = instance.Property.MemberInfo.GetCustomAttribute<IdAttribute>();
            if (idAttribute != null)
                columnName = idAttribute.ColumnName;

            instance.Column(columnName);
        }
开发者ID:evgenyk,项目名称:Brick.FluentNHibernate.Conventions,代码行数:10,代码来源:PrimaryKeyConvention.cs


示例10: Apply

 public void Apply(IIdentityInstance instance)
 {
     var tableName = instance.EntityType.Name.ToDatabaseName();
     instance.Column("ID");
     if (instance.Type == typeof(long))//接下来设置主键的生成方式为HiLo值方式
     {
         instance.GeneratedBy.HiLo(
             NHibernateHiLoIdentityTableName,
             NextHiValueColumnName,
             "1000000000",
             builder => builder.AddParam("where", string.Format("{0} = '{1}'", TableColumnName, tableName)));
     }
 }
开发者ID:zirain,项目名称:MiniOrchard,代码行数:13,代码来源:HiLoIdConvention.cs


示例11: Apply

        /// <summary>
        /// Applies primary key name.
        /// </summary>
        /// <param name="instance">The instance.</param>
        public void Apply( IIdentityInstance instance )
        {
            var key = instance.EntityType.Name;

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

            instance.Column ( key + "Key" );
            instance.Access.CamelCaseField ( CamelCasePrefix.Underscore );
            instance.GeneratedBy.Custom ( typeof( CustomTableHiLoGenerator ) );
        }
开发者ID:divyang4481,项目名称:REM,代码行数:17,代码来源:PrimaryKeyIdConvention.cs


示例12: Apply

        public void Apply(IIdentityInstance instance)
        {
            instance.Column("Id");

            if(instance.EntityType.BaseType==typeof(DomainEntity))
            {                
                //instance.UnsavedValue(Guid.Empty.ToString());
                instance.GeneratedBy.GuidComb();
            }
            else if (instance.EntityType.BaseType==typeof(Entity))
            { 
                instance.UnsavedValue("0");
                //instance.GeneratedBy.HiLo("1000");
            }
        }
开发者ID:marufbd,项目名称:Zephyr.NET,代码行数:15,代码来源:PrimaryKeyConvention.cs


示例13: Apply

        public void Apply(IIdentityInstance id)
        {
            var isAssigned = id.EntityType.GetCustomAttribute<IdAssignedAttribute>();
            if (isAssigned != null)
            {
                id.GeneratedBy.Assigned();
                return;
            }

            if (id.Type == typeof (Guid)) id.GeneratedBy.GuidComb();
            else if (id.Type == typeof (int)) id.GeneratedBy.Identity();
            else if (id.Type == typeof (long)) id.GeneratedBy.Identity();

            else if (id.Type == typeof(string)) id.GeneratedBy.Assigned();
            else id.GeneratedBy.Assigned();
        }
开发者ID:evgenyk,项目名称:Brick.FluentNHibernate.Conventions,代码行数:16,代码来源:PrimaryKeyGeneratorConvention.cs


示例14: Apply

 public void Apply(IIdentityInstance instance)
 {
     instance.GeneratedBy.HiLo("1000");
 }
开发者ID:Marceli,项目名称:JQueryGridTest,代码行数:4,代码来源:IdentityConvention.cs


示例15: Apply

 public void Apply(IIdentityInstance instance)
 {
     instance.Column($"{instance.EntityType.Name}ID");
     instance.GeneratedBy.HiLo("[dbo].[Ids]", "NextHigh", "9", $"EntityName = '{instance.EntityType.Name}'");
 }
开发者ID:Adiqq,项目名称:DDD-Playground,代码行数:5,代码来源:SessionFactory.cs


示例16: Apply

 /// <summary>
 /// Applies the specified instance.
 /// </summary>
 /// <param name="instance">The instance.</param>
 public void Apply(IIdentityInstance instance)
 {
     instance.GeneratedBy.Identity();
 }
开发者ID:coreframework,项目名称:Core-Framework,代码行数:8,代码来源:PrimaryKeyConvention.cs


示例17: Apply

 public void Apply(IIdentityInstance instance)
 {
     instance.Column(string.Format("{0}Id", instance.EntityType.Name));
 }
开发者ID:pleb,项目名称:Chillow,代码行数:4,代码来源:IDConvention.cs


示例18: Apply

 public void Apply(IIdentityInstance instance)
 {
     var originName = ConventionsUtilities
         .CamelCaseToUpperCaseWithUnderscoreSeparator(instance.EntityType.Name);
     instance.Column(originName + "_ID");
 }
开发者ID:lordviktor,项目名称:erp-project,代码行数:6,代码来源:PrimaryKeyNameConvention.cs


示例19: Apply

		public void Apply(IIdentityInstance instance)
		{
			instance.GeneratedBy.Assigned();
		}
开发者ID:shaynevanasperen,项目名称:Data.Operations,代码行数:4,代码来源:GeneratedByAssigned.cs


示例20: Apply

 public void Apply(IIdentityInstance instance)
 {
     instance.Access.Field();
 }
开发者ID:Kaidanov,项目名称:fluent-nhibernate,代码行数:4,代码来源:IdentityPartTester.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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