mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 04:18:16 +08:00
- 解决 表名名称包含点,无法进行 CRUD 的问题,由于测试的复杂性,此类情况仅支持 MySql/Sqlite CodeFirst 自动迁移;
> 注意:尽量不要使用带点的表名,只有 MySql/Sqlite 对此类表名支持 CodeFirst。但是它不影响 CRUD 功能,使用 [Table(Name = "`sys.config`")] 解决
This commit is contained in:
@ -4,7 +4,6 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public class RazorModel {
|
||||
public RazorModel(IFreeSql fsql, string nameSpace, bool[] NameOptions, List<DbTableInfo> tables, DbTableInfo table) {
|
||||
@ -55,7 +54,12 @@ public class RazorModel {
|
||||
var sb = new List<string>();
|
||||
|
||||
if (GetCsName(this.FullTableName) != this.FullTableName)
|
||||
sb.Add("Name = \"" + this.FullTableName + "\"");
|
||||
{
|
||||
if (this.FullTableName.IndexOf('.') == -1)
|
||||
sb.Add("Name = \"" + this.FullTableName + "\"");
|
||||
else
|
||||
sb.Add("Name = \"" + this.FullTableName + "\""); //Todo: QuoteSqlName
|
||||
}
|
||||
|
||||
if (sb.Any() == false) return null;
|
||||
return "[Table(" + string.Join(", ", sb) + ")]";
|
||||
|
Reference in New Issue
Block a user