当前位置: 首页>>代码示例>>C#>>正文


C# FluentNHibernate类代码示例

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


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

示例1: Apply

 public void Apply(FluentNHibernate.Conventions.Instances.IIdentityInstance instance)
 {
     instance.Column("Id");
     instance.UnsavedValue("0");
     //instance.GeneratedBy.Identity();
     //instance.GeneratedBy.HiLo("1000");
 }
开发者ID:manishma,项目名称:Demo,代码行数:7,代码来源:PrimaryKeyConvention.cs

示例2: GetKeyName

        protected override string GetKeyName(FluentNHibernate.Member property, Type type)
        {
            if (property == null)
                return type.Name + "ID";

            return property.Name + "ID";
        }
开发者ID:khoacoi,项目名称:ChatHubRD,代码行数:7,代码来源:ForeignKeyConvention.cs

示例3: Apply

 public void Apply(FluentNHibernate.Conventions.Instances.IIdentityInstance instance)
 {
     if (Attribute.IsDefined(instance.EntityType, typeof(GeneratedByAssignedAttribute)))
         instance.GeneratedBy.Assigned();
     else
         instance.Column("Id");
 }
开发者ID:Kendry06,项目名称:Gymnastika,代码行数:7,代码来源:IdConvention.cs

示例4: GetKeyName

        protected override string GetKeyName(FluentNHibernate.Member property, Type type)
        {
            if (property == null)
                return type.Name + "ID";  // many-to-many, one-to-many, join

            return property.Name + "ID"; // many-to-one
        }
开发者ID:elmo61,项目名称:BritBoxing,代码行数:7,代码来源:ForeignKeyConvention.cs

示例5: GetKeyName

        protected override string GetKeyName(FluentNHibernate.Member property, Type type)
        {
            if (property == null)
                return "fk_" + type.Name;

            return "fk_" + property.Name;
        }
开发者ID:hmattoso,项目名称:scc,代码行数:7,代码来源:ForeignKeyConvention.cs

示例6: Apply

 public void Apply(FluentNHibernate.Conventions.Instances.IOneToManyCollectionInstance instance)
 {
     instance.Key.Column(instance.EntityType.Name + "Id");
     instance.Cascade.AllDeleteOrphan();
     instance.Inverse();
     instance.Access.CamelCaseField(CamelCasePrefix.Underscore);//http://stackoverflow.com/questions/781443/private-collection-mapping-in-fluent-nhibernate
 }
开发者ID:scottccoates,项目名称:CliqFlip,代码行数:7,代码来源:HasManyConvention.cs

示例7: Apply

 public void Apply(FluentNHibernate.Conventions.Instances.IOneToManyCollectionInstance instance)
 {
     instance.Generic();
     instance.LazyLoad();
     instance.Fetch.Select();
     instance.BatchSize(10);
 }
开发者ID:shao2225883857,项目名称:SellersUnionWMS,代码行数:7,代码来源:HasManyConvention.cs

示例8: Apply

        public void Apply(FluentNHibernate.Conventions.Instances.IIdentityInstance instance)
        {
            if (instance.EntityType.BaseType != typeof (IntEntity))
                instance.GeneratedBy.Assigned();

            instance.UniqueKey("PK_" + instance.EntityType.Name);
        }
开发者ID:rjonker1,项目名称:lightstone-data-platform,代码行数:7,代码来源:PrimaryKeyConvention.cs

示例9: Apply

 public void Apply(FluentNHibernate.Conventions.Instances.IVersionInstance instance)
 {
     instance.Column("RowVersion");
     instance.Not.Nullable();
     instance.UnsavedValue("0");
     instance.Default(1);
 }
开发者ID:ViniciusConsultor,项目名称:elias,代码行数:7,代码来源:ConcorrencyConvention.cs

示例10: ShouldMap

 public override bool ShouldMap(FluentNHibernate.Member member)
 {
     if (member.IsProperty && !member.CanWrite)
     {
         return false;
     }
     return base.ShouldMap(member);
 }
开发者ID:tsubik,项目名称:SFASystem,代码行数:8,代码来源:AutoMappingConfiguration.cs

示例11: Apply

        public void Apply(FluentNHibernate.Conventions.Instances.IPropertyInstance instance)
        {
            var regexString = @"([A-Z][\w^[A-Z]]*)([A-Z][\w^[A-Z]]*)*";

            var newName = Regex.Replace(instance.Name, regexString, (m => (m.Index != 0 ? "_" : "") + m.Value.ToLower()));

            instance.Column(newName);
        }
开发者ID:kostyrin,项目名称:PointNet,代码行数:8,代码来源:ColumnConvention.cs

示例12: Apply

 public void Apply(FluentNHibernate.Conventions.Instances.IOneToManyCollectionInstance instance)
 {
     instance.Key.Column(instance.EntityType.Name + "Id");
     instance.Key.ForeignKey(instance.EntityType.Name+"_"+instance.ChildType.Name+"_FK");
     instance.Cascade.AllDeleteOrphan();
     instance.Inverse();
     instance.LazyLoad();
 }
开发者ID:vincentzh,项目名称:BeautySalonManagement,代码行数:8,代码来源:HasManyConvention.cs

示例13: GetKeyName

            protected override string GetKeyName(FluentNHibernate.Member property, Type type)
            {
                if (property == null)
                    return type.Name + "Id";

                // make foreign key compatible with Entity Framework
                return type.Name + "_" + property.Name + "Id";
            }
开发者ID:MichaelBuen,项目名称:ToTheEfnhX,代码行数:8,代码来源:NhDbMapper.cs

示例14: GetKeyName

        protected override string GetKeyName(FluentNHibernate.Member property, Type type)
        {
            if (property == null || typeof(Entity) == type.BaseType)
            {
                return type.Name + "Id";
            }

            return property.Name + "Id";
        }
开发者ID:kamukondiwa,项目名称:SimpleBlog,代码行数:9,代码来源:CustomForeignKeyConvention.cs

示例15: Apply

 public void Apply(FluentNHibernate.Conventions.Instances.IManyToManyCollectionInstance instance)
 {
     if (instance.OtherSide == null)
     {
         instance.Table(
            string.Format(
                "{0}To{1}",
                instance.EntityType.Name + "_Id",
                instance.ChildType.Name + "_Id"));
     }
     else
     {
         instance.Inverse();
     }
     instance.Cascade.All();
 }
开发者ID:tsubik,项目名称:SFASystem,代码行数:16,代码来源:CustomManyToManyConvention.cs


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