internal Response(ReturnCode result,
                          string postcode,
                          SpatialInfo spatialInfo,
                          Request input,
                          Model.Link[] links)
        {
            if (links == null) throw new ArgumentNullException("links");

            Result = result;
            Postcode = postcode;
            SpatialInfo = spatialInfo;
            Input = input;
            
            var newLinks = new List<Model.Link>();

            foreach (Model.Link link in links)
            {
                Model.Link newLink;

                switch (link.Rel)
                {
                    case "self":
                        newLink = new Link(link.Rel, link.Href);
                        break;
                    default:
                        newLink = link;
                        break;
                }

                newLinks.Add(newLink);
            }

            Links = newLinks.ToArray();
        }
Ejemplo n.º 2
0
        internal Response(ReturnCode result,
                          string postcode,
                          SpatialInfo spatialInfo,
                          Request input,
                          Model.Link[] links)
        {
            if (links == null)
            {
                throw new ArgumentNullException("links");
            }

            Result      = result;
            Postcode    = postcode;
            SpatialInfo = spatialInfo;
            Input       = input;

            var newLinks = new List <Model.Link>();

            foreach (Model.Link link in links)
            {
                Model.Link newLink;

                switch (link.Rel)
                {
                case "self":
                    newLink = new Link(link.Rel, link.Href);
                    break;

                default:
                    newLink = link;
                    break;
                }

                newLinks.Add(newLink);
            }

            Links = newLinks.ToArray();
        }