Ai
4 Star 11 Fork 8

鸣飞/BuildH框架代码开发辅助工具

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
TableInfo.cs 1.81 KB
一键复制 编辑 原始数据 按行查看 历史
鸣飞 提交于 2019-02-12 16:31 +08:00 . xxx
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CodeGenerator.Core
{
public class TableInfo
{
public string Name{ get; set; }
public string Comments { get; set; }
public List<ColumnInfo> ColumnList { get; set; }
public bool HasPirmaryKey
{
get
{
foreach (ColumnInfo current in this.ColumnList)
{
if (current.IsPrimaryKey=="是" || current.AutoIncrement=="是")
{
return true;
}
}
return false;
}
}
public List<ColumnInfo> PrimaryKeyColumns
{
get
{
List<ColumnInfo> list = new List<ColumnInfo>();
foreach (ColumnInfo current in this.ColumnList)
{
if (current.IsPrimaryKey=="是" || current.AutoIncrement =="是")
{
list.Add(current);
}
}
return list;
}
}
/// <summary>
/// 过滤掉表前缀的名称
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public string FilterName(string str)
{
string result = this.Name;
string[] prefixs = str.Split(',');
foreach (var prefix in prefixs)
{
if (!string.IsNullOrEmpty(prefix) && this.Name.Contains(prefix))
{
result = this.Name.Replace(prefix, "");
break;
}
}
return result;
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/mf_/CodeGenerator.git
git@gitee.com:mf_/CodeGenerator.git
mf_
CodeGenerator
BuildH框架代码开发辅助工具
master

搜索帮助