Skip to main content

Getting component data

C#
1
2
3
4
5
6
7
8
9
10
using Zengenti.Contensis.Delivery; public class MovieRole: ComponentModel { public string RoleName { get; set; } public string Description { get; set; } public Entry Person => Resolve<Entry>("person"); }
C#
1
2
3
4
5
// Access the director field data using the generic type MovieRole directorRole = movieEntry.Get<MovieRole>("director"); // The Person entry is fully resolved Entry director = directorRole.Person;
C#
1
2
3
4
5
// Alternatively return a dynamic object dynamic directorRole = movieEntry.Get("director"); // The Person entry is fully resolved Entry director = directorRole.Person;
C#
1
2
3
4
5
6
7
8
// Access the actors field data using the generic type List<MovieRole> actorRoles = movieEntry.Get<List<MovieRole>>("actors"); foreach(MovieRole role in actorRoles) { // The Person entry is fully resolved var actorName = role.Person.Get<string>("name"); }

Still need help?

New support request