refactor: 依赖组件升级
This commit is contained in:
parent
eb6bd3effb
commit
bd8a0d518c
|
@ -11,9 +11,9 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Bootstrap.Security.DataAccess" Version="2.2.0" />
|
<PackageReference Include="Bootstrap.Security.DataAccess" Version="2.2.1" />
|
||||||
<PackageReference Include="Longbow.Cache" Version="2.2.9" />
|
<PackageReference Include="Longbow.Cache" Version="2.2.9" />
|
||||||
<PackageReference Include="Longbow.Data" Version="2.3.1" />
|
<PackageReference Include="Longbow.Data" Version="2.3.2" />
|
||||||
<PackageReference Include="Longbow.Web" Version="2.2.11" />
|
<PackageReference Include="Longbow.Web" Version="2.2.11" />
|
||||||
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.2.4" />
|
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.2.4" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -11,15 +11,15 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Bootstrap.Security.DataAccess" Version="2.2.0" />
|
<PackageReference Include="Bootstrap.Security.DataAccess" Version="2.2.1" />
|
||||||
<PackageReference Include="Longbow.Data" Version="2.3.1" />
|
<PackageReference Include="Longbow.Data" Version="2.3.2" />
|
||||||
<PackageReference Include="Longbow.Logging" Version="2.2.6" />
|
<PackageReference Include="Longbow.Logging" Version="2.2.6" />
|
||||||
<PackageReference Include="Longbow.Security.Cryptography" Version="1.3.0" />
|
<PackageReference Include="Longbow.Security.Cryptography" Version="1.3.0" />
|
||||||
<PackageReference Include="Longbow.Web" Version="2.2.11" />
|
<PackageReference Include="Longbow.Web" Version="2.2.11" />
|
||||||
<PackageReference Include="Longbow.Cache" Version="2.2.9" />
|
<PackageReference Include="Longbow.Cache" Version="2.2.9" />
|
||||||
<PackageReference Include="Longbow" Version="2.2.9" />
|
<PackageReference Include="Longbow" Version="2.2.9" />
|
||||||
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.2.4" />
|
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.2.4" />
|
||||||
<PackageReference Include="PetaPoco.Extensions" Version="1.0.4" />
|
<PackageReference Include="PetaPoco.Extensions" Version="1.0.5" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -1,50 +1,20 @@
|
||||||
using PetaPoco;
|
using PetaPoco;
|
||||||
using System;
|
using System;
|
||||||
using System.Reflection;
|
|
||||||
|
|
||||||
namespace Bootstrap.DataAccess
|
namespace Bootstrap.DataAccess
|
||||||
{
|
{
|
||||||
internal class BootstrapDataAccessConventionMapper : IMapper
|
internal class BootstrapDataAccessConventionMapper : ConventionMapper
|
||||||
{
|
{
|
||||||
private readonly IMapper _mapper;
|
|
||||||
|
|
||||||
public BootstrapDataAccessConventionMapper()
|
|
||||||
{
|
|
||||||
_mapper = new ConventionMapper();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="pocoProperty"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public ColumnInfo GetColumnInfo(PropertyInfo pocoProperty) => _mapper.GetColumnInfo(pocoProperty);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="targetProperty"></param>
|
|
||||||
/// <param name="sourceType"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public Func<object, object> GetFromDbConverter(PropertyInfo targetProperty, Type sourceType) => _mapper.GetFromDbConverter(targetProperty, sourceType);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="pocoType"></param>
|
/// <param name="pocoType"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public TableInfo GetTableInfo(Type pocoType)
|
public override TableInfo GetTableInfo(Type pocoType)
|
||||||
{
|
{
|
||||||
var ti = _mapper.GetTableInfo(pocoType);
|
var ti = base.GetTableInfo(pocoType);
|
||||||
ti.AutoIncrement = true;
|
ti.AutoIncrement = true;
|
||||||
return ti;
|
return ti;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sourceProperty"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public Func<object, object> GetToDbConverter(PropertyInfo sourceProperty) => _mapper.GetToDbConverter(sourceProperty);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue