Пример #1
0
 public virtual T ExecuteScalar <S, T>(SqlQueryBuilder <S> builder) => _db.Connection.ExecuteScalar <T>(builder.Build(), builder.Parameters);
Пример #2
0
 public IEnumerable <T> LoadCollection <T>(SqlQueryBuilder <T> builder) => _db.Connection.Query <T>(builder.Build(), builder.Parameters);
Пример #3
0
 public virtual int ExecuteNonQuery <T>(SqlQueryBuilder <T> builder) =>
 _db.Connection.Execute(builder.Build(), builder.Parameters);
Пример #4
0
        //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);