mirror of
				https://github.com/nsnail/FreeSql.git
				synced 2025-11-04 17:20:49 +08:00 
			
		
		
		
	update
This commit is contained in:
		@@ -0,0 +1,35 @@
 | 
			
		||||
using System;
 | 
			
		||||
using System.Collections;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Reflection;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
using Newtonsoft.Json;
 | 
			
		||||
using FreeSql.DataAnnotations;
 | 
			
		||||
using System.Net;
 | 
			
		||||
using Newtonsoft.Json.Linq;
 | 
			
		||||
using System.Net.NetworkInformation;
 | 
			
		||||
using NpgsqlTypes;
 | 
			
		||||
using Npgsql.LegacyPostgis;
 | 
			
		||||
{%
 | 
			
		||||
var dbf = dbfirst as FreeSql.IDbFirst;
 | 
			
		||||
var cols = (table.Columns as List<DbColumnInfo>);
 | 
			
		||||
 | 
			
		||||
Func<string, string> UString = stra => stra.Substring(0, 1).ToUpper() + stra.Substring(1);
 | 
			
		||||
Func<DbColumnInfo, string> GetCsType = cola3 => {
 | 
			
		||||
	
 | 
			
		||||
	return dbf.GetCsType(cola3);
 | 
			
		||||
};
 | 
			
		||||
%}
 | 
			
		||||
namespace test.Model {
 | 
			
		||||
 | 
			
		||||
	[JsonObject(MemberSerialization.OptIn), Table(Name = "{#!string.IsNullOrEmpty(table.Schema) ? table.Schema + "." : ""}{#table.Name}"{if cols.Where(cola003 => cola003.Name.ToLower() == "is_deleted" || cola003.Name.ToLower() == "isdeleted").Any()}, SelectFilter = "a.IsDeleted = 1"{/if})]
 | 
			
		||||
	public partial class {#UString(table.Name)} {{for col,index in table.Columns}
 | 
			
		||||
		{if string.IsNullOrEmpty(col.Coment) == false}/// <summary>
 | 
			
		||||
		/// {#col.Coment.Replace("\r\n", "\n").Replace("\n", "\r\n		/// ")}
 | 
			
		||||
		/// </summary>{/if}
 | 
			
		||||
		[JsonProperty, Column(Name = "{#col.Name}", DbType = "{#col.DbTypeTextFull}"{if col.IsPrimary == true}, IsPrimary = true{/if}{if col.IsIdentity == true}, IsIdentity = true{/if}{if col.IsNullable == true}, IsNullable = true{/if})]
 | 
			
		||||
		public {#GetCsType(col)} {#UString(col.Name)} { get; set; }
 | 
			
		||||
		{/for}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user