111
This commit is contained in:
parent
7c4b44a4c9
commit
c4d2439c79
|
@ -61,7 +61,7 @@ namespace Sample.AutoCreateIfPresent
|
|||
var tableName = dataTable.Rows[i][TABLE_NAME]?.ToString() ?? string.Empty;
|
||||
if (tableName.StartsWith(CurrentTableName,StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
//如果没有下划线那么需要CurrentTableName.Length
|
||||
//如果没有下划线那么需要CurrentTableName.Length有下划线就要CurrentTableName.Length+1
|
||||
_tails.TryAdd(tableName.Substring(CurrentTableName.Length+1), null);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ public class WeatherForecastController : ControllerBase
|
|||
}
|
||||
public async Task<IActionResult> Query1()
|
||||
{
|
||||
var list = await _defaultDbContext.Set<AreaDevice>().Where(o=>o.Area=="x").ToListAsync();
|
||||
var list = await _defaultDbContext.Set<AreaDevice>().ToListAsync();
|
||||
return Ok(list);
|
||||
}
|
||||
public async Task<IActionResult> Insert1()
|
||||
|
|
|
@ -79,8 +79,7 @@ namespace Sample.AutoCreateIfPresent
|
|||
var tableName = dataTable.Rows[i][TABLE_NAME]?.ToString()??string.Empty;
|
||||
if (tableName.StartsWith(CurrentTableName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
//如果没有下划线那么需要CurrentTableName.Length
|
||||
var substring = tableName.Substring(CurrentTableName.Length+1);
|
||||
//如果没有下划线那么需要CurrentTableName.Length有下划线就要CurrentTableName.Length+1
|
||||
_tails.TryAdd(tableName.Substring(CurrentTableName.Length),null);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue