public bool Equals(JsonApiResourceIdentifier r)
        {
            if (r == null)
            {
                return false;
            }

            return Type.Equals(r.Type) && Id.Equals(r.Id);
        }
Exemple #2
0
        public bool Equals(JsonApiResourceIdentifier r)
        {
            if (r == null)
            {
                return(false);
            }

            return(Type.Equals(r.Type) && Id.Equals(r.Id));
        }
 public JsonApiResource(string type, string id)
 {
     Id = id;
     Type = type;
     ResourceIdentifier = new JsonApiResourceIdentifier(type, id);
 }
Exemple #4
0
        private JsonApiResource GetIncludedResourceByIdentifier(JsonApiResourceIdentifier resourceIdentifier)
        {
            var includedResource = _document.GetIncludedResourceByIdentifier(resourceIdentifier);

            if (includedResource == null)
            {
                throw new JsonApiFormatException(string.Format("No included resource found for identifier: {0}", resourceIdentifier));
            }

            return includedResource;
        }
 // note this glosses over some format issues, like if there are multiple included resources with the same identifier
 public JsonApiResource GetIncludedResourceByIdentifier(JsonApiResourceIdentifier id)
 {
     return Included.FirstOrDefault(jsonApiResource => jsonApiResource.ResourceIdentifier.Equals(id));
 }
Exemple #6
0
 public JsonApiResource(string type, string id)
 {
     Id   = id;
     Type = type;
     ResourceIdentifier = new JsonApiResourceIdentifier(type, id);
 }
 // note this glosses over some format issues, like if there are multiple included resources with the same identifier
 public JsonApiResource GetIncludedResourceByIdentifier(JsonApiResourceIdentifier id)
 {
     return(Included.FirstOrDefault(jsonApiResource => jsonApiResource.ResourceIdentifier.Equals(id)));
 }