Skip to main content

List

C#
1
2
3
public PagedList<Entry> List(PageOptions pageOptions = null) { }
C#
1
2
3
4
5
6
7
8
// Create a client var client = ContensisClient.Create(); // Get all entries with the default paging options var entries = client.Entries.List(); // Get all entries with specified paging options var entries = client.Entries.List(new PageOptions(3, 10));

List as typed model

C#
1
2
3
public PagedList<T> List<T>(PageOptions pageOptions = null) where T: class { }
C#
1
2
3
4
5
6
public class Movie { public string Title { get; set; } public DateTime DateOfRelease { get; set; } }
C#
1
2
3
4
5
6
7
8
// Create a client var client = ContensisClient.Create(); // Get all entries with the default paging options var movies = client.Entries.List<Movie>(); // Get all entries with specified paging options var movies = client.Entries.List<Movie>(new PageOptions(3, 10));

List async

C#
1
2
3
public async Task<PagedList<Entry>> List(PageOptions pageOptions = null) { }
C#
1
2
3
4
5
6
7
8
// Create a client var client = ContensisClient.Create(); // Get all entries with the default paging options var entries = await client.Entries.ListAsync(); // Get all entries with specified paging options var entries = await client.Entries.ListAsync(new PageOptions(3, 10));

List as typed model async

C#
1
2
3
public async Task<PagedList<T>> ListAsync<T>(PageOptions pageOptions = null) where T: class { }
C#
1
2
3
4
5
6
public class Movie { public string Title { get; set; } public DateTime DateOfRelease { get; set; } }
C#
1
2
3
4
5
6
7
8
// Create a client var client = ContensisClient.Create(); // Get all entries with the default paging options var entries = await client.Entries.ListAsync(); // Get all entries with specified paging options var entries = await client.Entries.ListAsync(new PageOptions(3, 10));

List by content type

C#
1
2
3
public PagedList<Entry> List(string contentTypeId, PageOptions pageOptions = null) { }
C#
1
2
3
4
5
6
7
8
// Create a client var client = ContensisClient.Create(); // Get entries with the default paging options var entries = client.Entries.List("movie"); // Get all entries with specified paging options var entries = client.Entries.List("movie", new PageOptions(3, 10));

List as typed model by content type

C#
1
2
3
public PagedList<T> List<T>(string contentTypeId, PageOptions pageOptions = null) where T: class { }
C#
1
2
3
4
5
6
public class Movie { public string Title { get; set; } public DateTime DateOfRelease { get; set; } }
C#
1
2
3
4
5
6
7
8
// Create a client var client = ContensisClient.Create(); // Get entries as typed models with the default paging options var entries = client.Entries.List<Movie>("movie"); // Get all entries as typed models with specified paging options var entries = client.Entries.List<Movie>("movie", new PageOptions(3, 10));

List by content type async

C#
1
2
3
public async Task<PagedList<Entry>> ListAsync(string contentTypeId, PageOptions pageOptions = null) { }
C#
1
2
3
4
5
6
7
8
// Create a client var client = ContensisClient.Create(); // Get entries with the default paging options var entries = await client.Entries.ListAsync("movie"); // Get all entries with specified paging options var entries = await client.Entries.ListAsync("movie", new PageOptions(3, 10));

List as typed model by content type async

C#
1
2
3
public async Task<PagedList<T>> ListAsync(string contentTypeId, PageOptions pageOptions = null) where T: class { }
C#
1
2
3
4
5
6
public class Movie { public string Title { get; set; } public DateTime DateOfRelease { get; set; } }
C#
1
2
3
4
5
6
7
8
// Create a client var client = ContensisClient.Create(); // Get entries as typed models with the default paging options var entries = await client.Entries.ListAsync<Movie>("movie"); // Get all entries as typed models with specified paging options var entries = await client.Entries.ListAsync<Movie>("movie", new PageOptions(3, 10));

List by content type with paging and ordering

C#
1
2
3
public PagedList<Entry> List(string contentTypeId, PageOptions pageOptions, IList<string> order) { }
C#
1
2
3
4
5
6
// Create a client var client = ContensisClient.Create(); // Get movie entries of with paging options and ordering var entries = client.Entries.List("movie", new PageOptions(3, 10), new [] { "title", "-dateOfRelease" } );

List as typed model by content type with paging and ordering

C#
1
2
3
public PagedList<T> List<T>(string contentTypeId, PageOptions pageOptions, IList<string> order) { }
C#
1
2
3
4
5
6
public class Movie { public string Title { get; set; } public DateTime DateOfRelease { get; set; } }
C#
1
2
3
4
5
6
// Create a client var client = ContensisClient.Create(); // Get movie entries as Movie instances with paging options and ordering var entries = client.Entries.List<Movie>("movie", new PageOptions(3, 10), new [] { "title", "-dateOfRelease" } );

List by content type with paging and ordering asynchronously

C#
1
2
3
public async Task<PagedList<Entry>> ListAsync(string contentTypeId, PageOptions pageOptions, SortFields sortFields) { }
C#
1
2
3
4
5
6
// Create a client var client = ContensisClient.Create(); // Get all entries with the default paging options var entries = await client.Entries.ListAsync("movie", new PageOptions(3, 10), new SortFields { new SortField("title", SortField.FieldSortDirection.Descending) });

List as typed model by content type with paging and ordering asynchronously

C#
1
2
3
public async Task<PagedList<T>> ListAsync<T>(string contentTypeId, PageOptions pageOptions, SortFields sortFields) { }
C#
1
2
3
4
5
// Create a client var client = ContensisClient.Create(); // Get all entries with the default paging options var entries = await client.Entries.ListAsync<Movie>("movie", new PageOptions(3, 10), new [] {"-title" });

List with options object

C#
1
2
3
public PagedList<Entry> List(EntryListOptions listOptions) { }
C#
1
2
3
4
5
6
7
8
9
10
11
12
13
// Create a client var client = ContensisClient.Create(); // Use the list options to filter the entry listing var entries = client.Entries.List(new EntryListOptions{ ContentTypeId = "movie", PageOptions = new PageOptions(3, 10), Order = new[] { "title", "-sys.version.created" }, Language = "fr-fr", LinkDepth = 5, Fields = new[] { "title", "description", "releaseDate", "coverImage" }, FieldLinkDepths = new Dictionary<string, int>{{"entryLink", 2},{"composer.component.entryLink", 1}} });

List as typed model with options object

C#
1
2
3
public PagedList<T> List<T>(EntryListOptions listOptions) { }
C#
1
2
3
4
5
6
public class Movie { public string Title { get; set; } public DateTime DateOfRelease { get; set; } }
C#
1
2
3
4
5
6
7
8
9
10
11
12
13
// Create a client var client = ContensisClient.Create(); // Use the list options to filter the entry listing var entries = client.Entries.List<Movie>(new EntryListOptions{ ContentTypeId = "movie", PageOptions = new PageOptions(3, 10), Order = new[] { "title", "-sys.version.created" }, Language = "fr-fr", LinkDepth = 5, Fields = new[] { "title", "dateOfRelease" }, FieldLinkDepths = new Dictionary<string, int>{{"entryLink", 2},{"composer.component.entryLink", 1}} });

List with options object asynchronously

C#
1
2
3
public Task<PagedList<Entry>> ListAsync(EntryListOptions listOptions) { }
C#
1
2
3
4
5
6
7
8
9
10
11
12
13
// Create a client var client = ContensisClient.Create(); // Use the list options to filter the entry data var entries = await client.Entries.ListAsync(new EntryListOptions{ ContentTypeId = "movie", PageOptions = new PageOptions(3, 10), Order = new[] { "title", "-sys.version.created" }, Language = "fr-fr", LinkDepth = 5, Fields = new { "title", "description", "releaseDate", "coverImage" }, FieldLinkDepths = new Dictionary<string, int>{{"entryLink", 2},{"composer.component.entryLink", 1}} });

List as typed model with options object asynchronously

C#
1
2
3
public async Task<PagedList<T>> ListAsync(EntryListOptions listOptions) { }
C#
1
2
3
4
5
6
public class Movie { public string Title { get; set; } public DateTime DateOfRelease { get; set; } }
C#
1
2
3
4
5
6
7
8
9
10
11
12
13
// Create a client var client = ContensisClient.Create(); // Use the list options to filter the entry data var entries = await client.Entries.ListAsync<Movie>(new EntryListOptions{ ContentTypeId = "movie", PageOptions = new PageOptions(3, 10), Order = new[] { "title", "-sys.version.created" }, Language = "fr-fr", LinkDepth = 5, Fields = new { "title", "-dateOfRelease" }, FieldLinkDepths = new Dictionary<string, int>{{"entryLink", 2},{"composer.component.entryLink", 1}} });

Still need help?

New support request