本文整理汇总了C#中IManyToOneInstance.Column方法的典型用法代码示例。如果您正苦于以下问题:C# IManyToOneInstance.Column方法的具体用法?C# IManyToOneInstance.Column怎么用?C# IManyToOneInstance.Column使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IManyToOneInstance
的用法示例。
在下文中一共展示了IManyToOneInstance.Column方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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));
}
示例2: 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();
}
示例3: 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");
}
示例4: 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());
}
示例5: 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"));
}
示例6: 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");
}
示例7: 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)));
}
示例8: 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);
}
示例9: 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" );
}
示例10: Apply
public void Apply(IManyToOneInstance instance)
{
string colName = null;
var referenceType = instance.Class.GetUnderlyingSystemType();
var entityType = instance.EntityType;
var propertyName = instance.Property.Name;
//Self association
if (referenceType == entityType)
colName = "ParentId";
else
colName = propertyName + "Id";
instance.Column(colName);
}
示例11: Apply
public void Apply(IManyToOneInstance instance)
{
string colName = string.Empty;
var referenceType = instance.Class.GetUnderlyingSystemType();
var entityType = instance.EntityType;
var propertyName = instance.Property.Name;
if (referenceType == entityType) // self association
{
colName = "PARENT_ID";
}
else
{
colName = propertyName.ToDatabaseName().ToUpper();
}
instance.Column(colName);
}
示例12: Apply
public void Apply(IManyToOneInstance instance)
{
string colName = null;
Type referenceType = instance.Class.GetUnderlyingSystemType();
Type entityType = instance.EntityType;
string propertyName = instance.Property.Name;
//instance.LazyLoad(Laziness.NoProxy);
//Self association
if (referenceType == entityType)
colName = "PARENT_ID";
else
colName = propertyName.ToDatabaseName() + "_ID";
instance.Column(colName);
instance.Cascade.None();
Debug.WriteLine("----ReferenceConvention----" + colName + instance.EntityType + " referenceType:" + referenceType);
}
示例13: Apply
public void Apply(IManyToOneInstance instance)
{
instance.Column("test_column");
}
示例14: Apply
public void Apply(IManyToOneInstance instance)
{
instance.Column(
instance.Name + "_" + instance.Property.PropertyType.Name + "Id");
}
示例15: Apply
public void Apply(IManyToOneInstance instance)
{
instance.Column(instance.Name + "Id");
instance.Cascade.SaveUpdate();
}