From bd8a0d518c8b1faeb4f7b12c5b406d7e30887cb1 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 19 May 2019 12:41:53 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BE=9D=E8=B5=96=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Bootstrap.Client.DataAccess.csproj | 4 +-- .../Bootstrap.DataAccess.csproj | 6 ++-- .../BootstrapDataAccessConventionMapper.cs | 36 ++----------------- 3 files changed, 8 insertions(+), 38 deletions(-) diff --git a/Bootstrap.Client.DataAccess/Bootstrap.Client.DataAccess.csproj b/Bootstrap.Client.DataAccess/Bootstrap.Client.DataAccess.csproj index 040ed850..92b71414 100644 --- a/Bootstrap.Client.DataAccess/Bootstrap.Client.DataAccess.csproj +++ b/Bootstrap.Client.DataAccess/Bootstrap.Client.DataAccess.csproj @@ -11,9 +11,9 @@ - + - + diff --git a/Bootstrap.DataAccess/Bootstrap.DataAccess.csproj b/Bootstrap.DataAccess/Bootstrap.DataAccess.csproj index b511be3d..5257d8f6 100644 --- a/Bootstrap.DataAccess/Bootstrap.DataAccess.csproj +++ b/Bootstrap.DataAccess/Bootstrap.DataAccess.csproj @@ -11,15 +11,15 @@ - - + + - + diff --git a/Bootstrap.DataAccess/BootstrapDataAccessConventionMapper.cs b/Bootstrap.DataAccess/BootstrapDataAccessConventionMapper.cs index 6ffec01a..ec7a8820 100644 --- a/Bootstrap.DataAccess/BootstrapDataAccessConventionMapper.cs +++ b/Bootstrap.DataAccess/BootstrapDataAccessConventionMapper.cs @@ -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(); - } - - /// - /// - /// - /// - /// - public ColumnInfo GetColumnInfo(PropertyInfo pocoProperty) => _mapper.GetColumnInfo(pocoProperty); - - /// - /// - /// - /// - /// - /// - public Func GetFromDbConverter(PropertyInfo targetProperty, Type sourceType) => _mapper.GetFromDbConverter(targetProperty, sourceType); - /// /// /// /// /// - 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; } - - /// - /// - /// - /// - /// - public Func GetToDbConverter(PropertyInfo sourceProperty) => _mapper.GetToDbConverter(sourceProperty); } }