Пример #1
0
        public void Test()
        {
            var items = new List <Person>
            {
                new Person(Guid.NewGuid(), "", DateTime.UtcNow),
                new Person(Guid.NewGuid(), "", DateTime.UtcNow),
                new Person(Guid.NewGuid(), "", DateTime.UtcNow)
            };

            var template = new PersonEntityTemplate();

            var entity = template
                         .ToEntity(items.First())
                         .WithClass("person")
                         .WithClass("collection")
                         .WithProperty("count", items.Count);

            foreach (var item in items)
            {
                entity.WithSubEntity(template.ToRepresentation(item).WithRel("item"));
            }

            entity.Build();
        }
Пример #2
0
 public void OneTimeSetUp()
 {
     _person   = new Person(Guid.NewGuid(), "Name", DateTime.UtcNow);
     _template = new PersonEntityTemplate();
 }