refactor: 依赖组件升级

This commit is contained in:
Argo Zhang 2019-05-19 12:41:53 +08:00
parent eb6bd3effb
commit bd8a0d518c
3 changed files with 8 additions and 38 deletions

View File

@ -11,9 +11,9 @@
</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.Data" Version="2.3.1" />
<PackageReference Include="Longbow.Data" Version="2.3.2" />
<PackageReference Include="Longbow.Web" Version="2.2.11" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.2.4" />
</ItemGroup>

View File

@ -11,15 +11,15 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Bootstrap.Security.DataAccess" Version="2.2.0" />
<PackageReference Include="Longbow.Data" Version="2.3.1" />
<PackageReference Include="Bootstrap.Security.DataAccess" Version="2.2.1" />
<PackageReference Include="Longbow.Data" Version="2.3.2" />
<PackageReference Include="Longbow.Logging" Version="2.2.6" />
<PackageReference Include="Longbow.Security.Cryptography" Version="1.3.0" />
<PackageReference Include="Longbow.Web" Version="2.2.11" />
<PackageReference Include="Longbow.Cache" Version="2.2.9" />
<PackageReference Include="Longbow" Version="2.2.9" />
<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>
</Project>

View File

@ -1,50 +1,20 @@
using PetaPoco;
using System;
using System.Reflection;
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>
/// <param name="pocoType"></param>
/// <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;
return ti;
}
/// <summary>
///
/// </summary>
/// <param name="sourceProperty"></param>
/// <returns></returns>
public Func<object, object> GetToDbConverter(PropertyInfo sourceProperty) => _mapper.GetToDbConverter(sourceProperty);
}
}