public UrlLinkedResource DeepCloneWithResourceKind(UrlLinkedResourceKind resourceKind)
        {
            var result = new UrlLinkedResource(
                this.Url?.DeepClone(),
                resourceKind);

            return(result);
        }
Exemple #2
0
        public UrlLinkedResource(
            string url,
            UrlLinkedResourceKind resourceKind)
        {
            if (url == null)
            {
                throw new ArgumentNullException(nameof(url));
            }

            if (string.IsNullOrWhiteSpace(url))
            {
                throw new ArgumentException(Invariant($"{nameof(url)} is white space."));
            }

            if (resourceKind == UrlLinkedResourceKind.Unknown)
            {
                throw new ArgumentOutOfRangeException(Invariant($"{nameof(resourceKind)} is {nameof(UrlLinkedResourceKind.Unknown)}."));
            }

            this.Url          = url;
            this.ResourceKind = resourceKind;
        }