diff --git a/src/NuClear.Dapper/RepositoryBase.cs b/src/NuClear.Dapper/RepositoryBase.cs index 250b8ae..88b1ae7 100644 --- a/src/NuClear.Dapper/RepositoryBase.cs +++ b/src/NuClear.Dapper/RepositoryBase.cs @@ -2,6 +2,7 @@ using NuClear.Dapper.AggregateQueryObject; using NuClear.Dapper.Context; using NuClear.Dapper.QueryObject; +using NuClear.Dapper.SqlResources; using System; using System.Collections.Generic; using System.Data; @@ -17,6 +18,7 @@ public abstract class RepositoryBase : IRepository where TEnti protected abstract IAggrQuerySqlParser AggrQuerySqlParser { get; } protected abstract ISqlParser SqlParser { get; } protected abstract ICriterionSqlParser CriterionSqlParser { get; } + protected abstract ISqlResource SqlResource { get; } protected IDbConnection Conn { get { return Context.Connection; } } protected IDbTransaction Tran { get { return Context.Transaction; } } @@ -85,7 +87,6 @@ protected async Task> InternalQueryAsync CountAsync(Query query) string whereSql = GetWhereSql(query, out object param); return await this.CountAsync(CombineCountSql(this.SelectSql, whereSql), param); } - + #endregion #region Exists @@ -684,10 +685,10 @@ public void Dispose() #region Sql public virtual string TableAliasName { get { return ""; } } - public abstract string SelectSql { get; } - public abstract string InsertSql { get; } - public abstract string UpdateSql { get; } - public abstract string DeleteSql { get; } + public virtual string SelectSql { get { return SqlResource.Select; } } + public virtual string InsertSql { get { return SqlResource.Insert; } } + public virtual string UpdateSql { get { return SqlResource.Update; } } + public virtual string DeleteSql { get { return SqlResource.Delete; } } #endregion } }