using PetaPoco; using System; using System.Reflection; namespace Bootstrap.DataAccess { internal class BootstrapDataAccessConventionMapper : IMapper { 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) { var ti = _mapper.GetTableInfo(pocoType); ti.AutoIncrement = true; return ti; } /// /// /// /// /// public Func GetToDbConverter(PropertyInfo sourceProperty) => _mapper.GetToDbConverter(sourceProperty); } }