FreeSql/FreeSql/DataAnnotations/TableAttribute.cs
28810 b97156b482 - 增加 IFreeSql.GlobalFilter 全局过滤器;
- 移除 TableAttribute.SelectFilter 功能;
2019-10-24 02:17:22 +08:00

31 lines
1.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Concurrent;
using System.Linq.Expressions;
namespace FreeSql.DataAnnotations
{
[AttributeUsage(AttributeTargets.Class)]
public class TableAttribute : Attribute
{
/// <summary>
/// 数据库表名
/// </summary>
public string Name { get; set; }
/// <summary>
/// 指定数据库旧的表名修改实体命名时同时设置此参数为修改之前的值CodeFirst才可以正确修改数据库表否则将视为【创建新表】
/// </summary>
public string OldName { get; set; }
internal bool? _DisableSyncStructure;
/// <summary>
/// 禁用 CodeFirst 同步结构迁移
/// </summary>
public bool DisableSyncStructure { get => _DisableSyncStructure ?? false; set => _DisableSyncStructure = value; }
internal ConcurrentDictionary<string, ColumnAttribute> _columns { get; } = new ConcurrentDictionary<string, ColumnAttribute>(StringComparer.CurrentCultureIgnoreCase);
internal ConcurrentDictionary<string, NavigateAttribute> _navigates { get; } = new ConcurrentDictionary<string, NavigateAttribute>(StringComparer.CurrentCultureIgnoreCase);
internal ConcurrentDictionary<string, IndexAttribute> _indexs { get; } = new ConcurrentDictionary<string, IndexAttribute>(StringComparer.CurrentCultureIgnoreCase);
}
}