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

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

            return(Type.Equals(r.Type) && Id.Equals(r.Id));
        }
Ejemplo n.º 3
0
 public JsonApiResource(string type, string id)
 {
     Id = id;
     Type = type;
     ResourceIdentifier = new JsonApiResourceIdentifier(type, id);
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 5
0
 // 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));
 }
Ejemplo n.º 6
0
 public JsonApiResource(string type, string id)
 {
     Id   = id;
     Type = type;
     ResourceIdentifier = new JsonApiResourceIdentifier(type, id);
 }
Ejemplo n.º 7
0
 // 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)));
 }