代码类文件移动(不影响功能)

This commit is contained in:
28810
2019-10-08 00:43:03 +08:00
parent 53d4332bc5
commit fa48170041
3 changed files with 67 additions and 46 deletions

View File

@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace FreeSql.DataAnnotations
{
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public class IndexAttribute : Attribute
{
public IndexAttribute(string name, string fields)
{
this.Name = name;
this.Fields = fields;
}
public IndexAttribute(string name, string fields, bool isUnique)
{
this.Name = name;
this.Fields = fields;
this.IsUnique = isUnique;
}
/// <summary>
/// 索引名
/// </summary>
public string Name { get; set; }
/// <summary>
/// 索引字段为属性名以逗号分隔Create_time ASC, Title ASC
/// </summary>
public string Fields { get; set; }
internal bool? _IsUnique;
/// <summary>
/// 是否唯一
/// </summary>
public bool IsUnique { get => _IsUnique ?? false; set => _IsUnique = value; }
}
}

View File

@@ -31,34 +31,4 @@ namespace FreeSql.DataAnnotations
internal ConcurrentDictionary<string, NavigateAttribute> _navigates { get; } = new ConcurrentDictionary<string, NavigateAttribute>(StringComparer.CurrentCultureIgnoreCase);
internal ConcurrentDictionary<string, IndexAttribute> _indexs { get; } = new ConcurrentDictionary<string, IndexAttribute>(StringComparer.CurrentCultureIgnoreCase);
}
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public class IndexAttribute : Attribute
{
public IndexAttribute(string name, string fields)
{
this.Name = name;
this.Fields = fields;
}
public IndexAttribute(string name, string fields, bool isUnique)
{
this.Name = name;
this.Fields = fields;
this.IsUnique = isUnique;
}
/// <summary>
/// 索引名
/// </summary>
public string Name { get; set; }
/// <summary>
/// 索引字段为属性名以逗号分隔Create_time ASC, Title ASC
/// </summary>
public string Fields { get; set; }
internal bool? _IsUnique;
/// <summary>
/// 是否唯一
/// </summary>
public bool IsUnique { get => _IsUnique ?? false; set => _IsUnique = value; }
}
}