public Entity Handle() { return(new EntityBuilder() .WithClass("status") .WithProperty("currentUtcTime", DateTime.UtcNow) .WithLink(() => LinkFactory.Create("status", true)) .Build()); }
public void Add(Link model) { var entity = LinkFactory.Create(model); _linkRepository.Add(entity); model.Id = entity.Id; }
public Entity Handle() { return(new EntityBuilder() .WithClass("root") .WithLink(() => LinkFactory.Create("root", true)) .WithLink(() => LinkFactory.Create("items", false)) .WithLink(() => LinkFactory.Create("basket", false)) .WithLink(() => LinkFactory.Create("status", false)) .Build()); }
private Entity BuildEntity(Basket basket, Account account) { var entityBuilder = new EntityBuilder() .WithClass("basket") .WithClass("collection") .WithProperty("price", Checkout.GetTotal(basket).Units) .WithLink(() => LinkFactory.Create("basket", true)) .WithLink(() => LinkFactory.Create("items", false)); return(WithSubEntities(entityBuilder, basket, account).Build()); }
public Entity Handle() { var item = ItemRepository.Get(_id); return(new EntityBuilder() .WithClass("item") .WithProperty("id", item.Id) .WithProperty("value", item.Value.Units) .WithLink(() => LinkFactory.Create("item", _id, true)) .WithAction(() => ActionFactory.Create("basket", "post", item)) .Build()); }
public Entity Handle() { return(new EntityBuilder() .WithClass("items") .WithClass("collection") .WithEntity(_itemRepository.Get() .Select(item => new AnemicItemModule(Request, item.Id).Handle()) .Select <Entity, Func <Entity> >(entity => () => entity)) .WithLink(() => LinkFactory.Create("items", true)) .WithLink(() => LinkFactory.Create("basket", false)) .Build()); }
public void Update(Link model) { var entity = LinkFactory.Create(model); _linkRepository.Update(entity); }
public Link Get(int id) { var entity = _linkRepository.Get(id); return(LinkFactory.Create(entity)); }