如下图所示,我有两个表,我想在表2中插入记录并从表1中映射LicenseID。但我想根据ComapanyCount和表2中的LicenseID选择LicenseID。意味着我可以映射LicenseID 9在5个记录之后,表2中的5条记录应该给我下一个LicenseID,即12,我可以用表2中的3条记录映射。
答案 0 :(得分:0)
table1和table2之间的关系不是很清楚。以下查询应根据需要更新表2中的licenseID。
public async Task<RestResult<T>> Post<T>(HttpContent content)
{
using (HttpClient httpClient = new HttpClient())
{
HttpResponseMessage response = await httpClient.PostAsync(Endpoint, content);
if (response.StatusCode == HttpStatusCode.Created)
{
T result = JsonConvert.DeserializeObject<T>(await response.Content.ReadAsStringAsync());
return new RestResult<T> { Result = result, ResultCode = HttpStatusCode.OK };
}
RestResult<T> nonOkResult =
new RestResult<T> { Result = default(T), ResultCode = response.StatusCode, Message = await response.Content.ReadAsStringAsync() };
return nonOkResult;
}
}