public virtual T ExecuteScalar <S, T>(SqlQueryBuilder <S> builder) => _db.Connection.ExecuteScalar <T>(builder.Build(), builder.Parameters);
public IEnumerable <T> LoadCollection <T>(SqlQueryBuilder <T> builder) => _db.Connection.Query <T>(builder.Build(), builder.Parameters);
public virtual int ExecuteNonQuery <T>(SqlQueryBuilder <T> builder) => _db.Connection.Execute(builder.Build(), builder.Parameters);
//public T GetByExternalId<T>(Guid id) where T : BaseEntity //{ // var builder = new SqlQueryBuilder<T>(); // builder.SelectTopStar(1).From(TableName, Schema).Where(t => t.ExternalGuid).EqualTo(id); // return LoadSingle(builder); //} public T LoadSingle <T>(SqlQueryBuilder <T> builder) => _db.Connection.QueryFirstOrDefault <T>(builder.Build(), builder.Parameters);