Skip to main content

Getting an entry (update)

Log in to add to favourites

Get by Guid id

C#
1
2
3
public Entry Get(Guid id, string language = null, int linkDepth = 0, IList<string> fields = null, Dictionary<string, int> fieldLinkDepths = null) { }
C#
1
2
3
4
5
// Create a client var client = ContensisClient.Create(); // Get the french variation of the movie entry, returning just the title and resolving links to a depth of 3, except for the entryLink fields which resolves to a depth of 2 and the relatedItems component in the composer field, which resolves to a depth of 1 Entry movie = client.Entries.Get(movieGuid, "fr-fr", 3, new[] {"title"}, new Dictionary<string, int>{{"entryLink", 2}, {"composer.relatedItems", 1}});

Get typed model by Guid id

C#
1
2
3
public T Get<T>(Guid id, string language = null, int linkDepth = 0, IList<string> fields = null, Dictionary<string, int> fieldLinkDepths) 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
// Create a client var client = ContensisClient.Create(); // Get the french variation of the movie entry, returning just the title and resolving links to a depth of 3, except for the entryLink fields which resolves to a depth of 2 and the relatedItems component in the composer field, which resolves to a depth of 1 Movie movie = client.Entries.Get<Movie>(movieGuid, "fr-fr", 3, new[] {"title"}, new Dictionary<string, int>{{"entryLink", 2}, {"composer.relatedItems", 1}});

Get by string id

C#
1
2
3
public Entry Get(string id, string languageCode = null, int linkDepth = 0, IList<string> fields = null, Dictionary<string, int> fieldLinkDepths = null) { }
C#
1
2
3
4
5
// Create a client var client = ContensisClient.Create(); // Get the french variation of the movie entry, returning just the title and resolving links to a depth of 3, except for the entryLink fields which resolves to a depth of 2 and the relatedItems component in the composer field, which resolves to a depth of 1 Entry movie = client.Entries.Get("456e5f2a-a1cf-4520-a46c-e5f22ed299e8", "fr-fr", 3, new[] {"title"}, new Dictionary<string, int>{{"entryLink", 2}, {"composer.relatedItems", 1}});

Get typed model by string id

C#
1
2
3
public T Get<T>(string id, string languageCode = null, int linkDepth = 0, IList<string> fields = null, Dictionary<string, int> fieldLinkDepths = 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
// Create a client var client = ContensisClient.Create(); // Get the french variation of the movie entry, returning just the title and resolving links to a depth of 3, except for the entryLink fields which resolves to a depth of 2 and the relatedItems component in the composer field, which resolves to a depth of 1 Movie movie = client.Entries.Get<Movie>("456e5f2a-a1cf-4520-a46c-e5f22ed299e8", "fr-fr", 3, new[] {"title"}, new Dictionary<string, int>{{"entryLink", 2}, {"composer.relatedItems", 1}});

Get by Guid id async

C#
1
2
3
public async Task<Entry> GetAsync(Guid id, string language = null, int linkDepth = 0, IList<string> fields = null, Dictionary<string, int> fieldLinkDepths = null) { }
C#
1
2
3
4
5
// Create a client var client = ContensisClient.Create(); // Get the french variation of the movie entry, returning just the title and resolving links to a depth of 3, except for the entryLink fields which resolves to a depth of 2 and the relatedItems component in the composer field, which resolves to a depth of 1 Entry movie = await client.Entries.GetAsync(movieGuid, "fr-fr", 3, new[] {"title"}, new Dictionary<string, int>{{"entryLink", 2}, {"composer.relatedItems", 1}});

Get typed model by Guid id async

C#
1
2
3
public async Task<T> GetAsync<T>(Guid id, string language = null, int linkDepth = 0, IList<string> fields = null, Dictionary<string, int> fieldLinkDepths = 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
// Create a client var client = ContensisClient.Create(); // Get the french variation of the movie entry as a Movie type, returning just the title and resolving links to a depth of 3, except for the entryLink fields which resolves to a depth of 2 and the relatedItems component in the composer field, which resolves to a depth of 1 Movie movie = await client.Entries.GetAsync<Movie>(movieGuid, "fr-fr", 3, new[] {"title"}, new Dictionary<string, int>{{"entryLink", 2}, {"composer.relatedItems", 1}});

Get by string id async

C#
1
2
3
public async Task<Entry> GetAsync(string id, string language = null, int linkDepth = 0, IList<string> fields = null, Dictionary<string, int> fieldLinkDepths = null) { }
C#
1
2
3
4
5
// Create a client var client = ContensisClient.Create(); // Get the french variation of the movie entry, returning just the title and resolving links to a depth of 3, except for the entryLink fields which resolves to a depth of 2 and the relatedItems component in the composer field, which resolves to a depth of 1 Entry movie = await client.Entries.GetAsync("456e5f2a-a1cf-4520-a46c-e5f22ed299e8", "fr-fr", 3, new[] {"title"}, new Dictionary<string, int>{{"entryLink", 2}, {"composer.relatedItems", 1}});

Get typed model by string id async

C#
1
2
3
public async Task<T> GetAsync<T>(string id, string language = null, int linkDepth = 0, IList<string> fields = null, Dictionary<string, int> fieldLinkDepths = 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
// Create a client var client = ContensisClient.Create(); // Get the french variation of the movie entry as a Movie type, returning just the title and resolving links to a depth of 3, except for the entryLink fields which resolves to a depth of 2 and the relatedItems component in the composer field, which resolves to a depth of 1 Movie movie = await client.Entries.GetAsync<Movie>("456e5f2a-a1cf-4520-a46c-e5f22ed299e8", "fr-fr", 3, new[] {"title"}, new Dictionary<string, int>{{"entryLink", 2}, {"composer.relatedItems", 1}});

Still need help?

New support request