Add : db.InsertByObject(type).ExecuteReturnSnowflakeIdAsync()

This commit is contained in:
sunkaixuan
2023-12-05 21:57:14 +08:00
parent 45ef7354ef
commit 0973a21012

View File

@@ -73,5 +73,20 @@ namespace SqlSugar
Context = result Context = result
}; };
} }
public long ExecuteReturnSnowflakeId()
{
if (Context == null) return 0;
var inertable = MethodInfo.Invoke(Context, new object[] { objectValue });
var result = inertable.GetType().GetMethod("ExecuteReturnSnowflakeId").Invoke(inertable, new object[] { });
return (long)result;
}
public async Task<long> ExecuteReturnSnowflakeIdAsync()
{
if (Context == null) return 0;
var inertable = MethodInfo.Invoke(Context, new object[] { objectValue });
var result = inertable.GetType().GetMyMethod("ExecuteReturnSnowflakeIdAsync", 0).Invoke(inertable, new object[] { });
return await (Task<long>)result;
}
} }
} }