SqlServer CodeFirst 适配完成(同步结构)

This commit is contained in:
28810
2018-12-19 12:06:04 +08:00
parent 7bfe4efb2c
commit df07b7bcc4
9 changed files with 153 additions and 48 deletions

View File

@ -231,7 +231,8 @@ namespace test.Model {
var affrows = mysql.Update<{#UString(table.Name)}>().Where(a => {#parmsByWhereLambda}).ExecuteAffrows();
if (affrows > 0) return;
}{/if}
{if pks.Count > 0}this.{#UString(idensCol.Name)} = {#GetCsType(idensCol).Replace("?", "") == "long" ? "" : ("(" + GetCsType(idensCol) + ")")}mysql.Insert<{#UString(table.Name)}>().AppendData(this).ExecuteIdentity();{else}mysql.Insert<{#UString(table.Name)}>().AppendData(this).ExecuteAffrows();{/if}
{if idens > 0}this.{#UString(idensCol.Name)} = {#GetCsType(idensCol).Replace("?", "") == "long" ? "" : ("(" + GetCsType(idensCol) + ")")}mysql.Insert<{#UString(table.Name)}>().AppendData(this).ExecuteIdentity();{else}
mysql.Insert<{#UString(table.Name)}>().AppendData(this).ExecuteAffrows();{/if}
}
{/if}
}