List entries
Log in to add to favouritesRequesting a list of entries can be achieved by using one of the List method overloads.
- List(PageOptions pageOptions)
- List<T>(PageOptions pageOptions)
- ListAsync(PageOption pageOptions)
- ListAsync<T>(PageOption pageOptions)
- List(string contentTypeId, PageOptions pageOptions)
- List<T>(string contentTypeId, PageOptions pageOptions)
- ListAsync(string contentTypeId, PageOptions pageOptions)
- ListAsync<T>(string contentTypeId, PageOptions pageOptions)
- List(string contentTypeId, PageOptions pageOptions, IList order)
- List<T>(string contentTypeId, PageOptions pageOptions, IList order)
- ListAsync(string contentTypeId, PageOptions pageOptions, IList order)
- ListAsync<T>(string contentTypeId, PageOptions pageOptions, IList order)
- List(EntryListOptions listOptions)
- List<T>(EntryListOptions listOptions)
- ListAsync(EntryListOptions listOptions)
- ListAsync<T>(EntryListOptions listOptions)
List
Lists entries for all content types, with paging.
Syntax
public PagedList<Entry> List(PageOptions pageOptions = null)
{
}
Parameters
pageOptions
Type: PageOptions
Paging options for specifying the page index and size.
Remarks
The default for the pageOptions is PageSize: 25, PageIndex: 0.
Examples
// 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
Lists entries as typed models for all content types, with paging.
Syntax
public PagedList<T> List<T>(PageOptions pageOptions = null) where T: class
{
}
Parameters
T
The model class, either a plain class or inheriting from EntryModel.
pageOptions
Type: PageOptions
Paging options for specifying the page index and size.
Remarks
The default for the pageOptions is PageSize: 25, PageIndex: 0.
Examples
public class Movie
{
public string Title { get; set; }
public DateTime DateOfRelease { get; set; }
}
// 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
Lists entries for all content types asynchronously, with paging.
Syntax
public async Task<PagedList<Entry>> List(PageOptions pageOptions = null)
{
}
Parameters
pageOptions
Type: PageOptions
Paging options for specifying the page index and size.
Remarks
The default for the PageOptions is PageSize: 25, PageIndex: 0.
Examples
// 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
Lists entries as typed models for all content types asynchronously, with paging.
Syntax
public async Task<PagedList<T>> ListAsync<T>(PageOptions pageOptions = null) where T: class
{
}
Parameters
T
The model class, either a plain class or inheriting from EntryModel.
pageOptions
Type: PageOptions
Paging options for specifying the page index and size.
Remarks
The default for the PageOptions is PageSize: 25, PageIndex: 0.
Examples
public class Movie
{
public string Title { get; set; }
public DateTime DateOfRelease { get; set; }
}
// 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
Lists entries for a specific content type.
Syntax
public PagedList<Entry> List(string contentTypeId, PageOptions pageOptions = null)
{
}
Parameters
contentTypeId
Type: string
The id of the content type to restrict the entries by.
pageOptions
Type: PageOptions
Paging options for specifying the page index and size.
Remarks
The default for the PageOptions is PageSize: 25, PageIndex: 0.
Examples
// 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
Lists entries as typed models for a specific content type.
Syntax
public PagedList<T> List<T>(string contentTypeId, PageOptions pageOptions = null) where T: class
{
}
Parameters
T
The model class, either a plain class or inheriting from EntryModel.
contentTypeId
Type: string
The id of the content type to restrict the entries by.
pageOptions
Type: PageOptions
Paging options for specifying the page index and size.
Remarks
The default for the PageOptions is PageSize: 25, PageIndex: 0.
Examples
public class Movie
{
public string Title { get; set; }
public DateTime DateOfRelease { get; set; }
}
// 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
Lists entries for a specific content type.
Syntax
public async Task<PagedList<Entry>> ListAsync(string contentTypeId, PageOptions pageOptions = null)
{
}
Parameters
contentTypeId
Type: string
The id of the content type to restrict the entries by.
pageOptions
Type: PageOptions
Paging options for specifying the page index and size.
Remarks
The default for the PageOptions is PageSize: 25, PageIndex: 0.
Examples
// 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
Lists entries as typed models for a specific content type.
Syntax
public async Task<PagedList<T>> ListAsync(string contentTypeId, PageOptions pageOptions = null) where T: class
{
}
Parameters
T
The model class, either a plain class or inheriting from EntryModel.
contentTypeId
Type: string
The id of the content type to restrict the entries by.
pageOptions
Type: PageOptions
Paging options for specifying the page index and size.
Remarks
The default for the PageOptions is PageSize: 25, PageIndex: 0.
Examples
public class Movie
{
public string Title { get; set; }
public DateTime DateOfRelease { get; set; }
}
// 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
Lists entries for a specific content type, with paging and field order configuration.
Syntax
public PagedList<Entry> List(string contentTypeId, PageOptions pageOptions, IList<string> order)
{
}
Parameters
contentTypeId
Type: string
The id of the content type to restrict the entries by.
pageOptions
Type: PageOptions
Paging options for specifying the page index and size.
order
Type: IList<string>
Options for specifying the result ordering.
Remarks
The default for the PageOptions is PageSize: 25, PageIndex: 0.
Examples
// 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
Lists entries as typed models for a specific content type, with paging and field order configuration.
Syntax
public PagedList<T> List<T>(string contentTypeId, PageOptions pageOptions, IList<string> order)
{
}
Parameters
T
The model class, either a plain class or inheriting from EntryModel.
contentTypeId
Type: string
The id of the content type to restrict the entries by.
pageOptions
Type: PageOptions
Paging options for specifying the page index and size.
order
Type: IList<string>
Options for specifying the result ordering.
Remarks
The default for the PageOptions is PageSize: 25, PageIndex: 0.
Examples
public class Movie
{
public string Title { get; set; }
public DateTime DateOfRelease { get; set; }
}
// 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
Lists entries for a specific content type, with paging and field sort configuration.
Syntax
public async Task<PagedList<Entry>> ListAsync(string contentTypeId, PageOptions pageOptions, SortFields sortFields)
{
}
Parameters
contentTypeId
Type: string
The id of the content type to restrict the entries by.
pageOptions
Type: PageOptions
Paging options for specifying the page index and size.
sortFields
Type: SortFields
Options for specifying the result ordering.
Remarks
The default for the PageOptions is PageSize: 25, PageIndex: 0.
Examples
// 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
Lists entries as typed models for a specific content type, with paging and field sort configuration.
Syntax
public async Task<PagedList<T>> ListAsync<T>(string contentTypeId, PageOptions pageOptions, SortFields sortFields)
{
}
Parameters
T
The model class, either a plain class or inheriting from EntryModel.
contentTypeId
Type: string
The id of the content type to restrict the entries by.
pageOptions
Type: PageOptions
Paging options for specifying the page index and size.
sortFields
Type: SortFields
Options for specifying the result ordering.
Remarks
The default for the PageOptions is PageSize: 25, PageIndex: 0.
Examples
// 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
Lists entries using an EntryListOptions object to allow more granular control of entries being returned.
Syntax
public PagedList<Entry> List(EntryListOptions listOptions)
{
}
Parameters
listOptions
Type: EntryListOptions
Allows all parameters to be optionally set and exposes less commonly used parameters.
Remarks
The default for the PageOptions is PageSize: 25, PageIndex: 0.
Examples
// 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
Lists entries as typed models using an EntryListOptions object to allow more granular control of entries being returned.
Syntax
public PagedList<T> List<T>(EntryListOptions listOptions)
{
}
Parameters
T
The model class, either a plain class or inheriting from EntryModel.
listOptions
Type: EntryListOptions
Allows all parameters to be optionally set and exposes less commonly used parameters.
Remarks
The default for the PageOptions is PageSize: 25, PageIndex: 0.
Examples
public class Movie
{
public string Title { get; set; }
public DateTime DateOfRelease { get; set; }
}
// 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
Lists entries using an EntryListOptions object to allow more granular control of entries being returned.
Syntax
public Task<PagedList<Entry>> ListAsync(EntryListOptions listOptions)
{
}
Parameters
listOptions
Type: EntryListOptions
Allows all parameters to be optionally set and exposes less commonly used parameters.
Remarks
The default for the PageOptions is PageSize: 25, PageIndex: 0.
Examples
// 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
Lists entries using an EntryListOptions object to allow more granular control of entries being returned.
Syntax
public async Task<PagedList<T>> ListAsync(EntryListOptions listOptions)
{
}
Parameters
T
The model class, either a plain class or inheriting from EntryModel.
listOptions
Type: EntryListOptions
Allows all parameters to be optionally set and exposes less commonly used parameters.
Remarks
The default for the PageOptions is PageSize: 25, PageIndex: 0.
Examples
public class Movie
{
public string Title { get; set; }
public DateTime DateOfRelease { get; set; }
}
// 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}}
});