Ejemplo n.º 1
0
        public void Enrich(IHalResponseBuilder halResponseBuilder, ServiceAggregate service)
        {
            if (halResponseBuilder == null)
            {
                throw new ArgumentNullException(nameof(halResponseBuilder));
            }

            if (service == null)
            {
                throw new ArgumentNullException(nameof(service));
            }

            halResponseBuilder.AddEmbedded(e => e.AddObject(_responseBuilder.GetService(service),
                                                            (l) =>
            {
                l.AddOtherItem("shop", new Dtos.Link("/" + Constants.RouteNames.Shops + "/" + service.ShopId)).AddSelf(Constants.RouteNames.Services + "/" + service.Id);
            }));
        }