Simple.Data.Npgsql by Chris Hogan,Yaroslav Tatarenko

<PackageReference Include="Simple.Data.Npgsql" Version="0.19.1" />

 PgQueryPager

public class PgQueryPager : IQueryPager
using Simple.Data.Ado; using System.Collections.Generic; using System.ComponentModel.Composition; using System.Text; namespace Simple.Data.Npgsql { [Export(typeof(IQueryPager))] public class PgQueryPager { public IEnumerable<string> ApplyLimit(string sql, int take) { StringBuilder stringBuilder = new StringBuilder(sql); stringBuilder.AppendFormat(" LIMIT {0}", take); yield return stringBuilder.ToString(); } public IEnumerable<string> ApplyPaging(string sql, string[] keys, int skip, int take) { StringBuilder stringBuilder = new StringBuilder(sql); stringBuilder.AppendFormat(" LIMIT {0} OFFSET {1}", take, skip); yield return stringBuilder.ToString(); } } }