/// <summary> /// Returns the resource found in the database. The resource could be active (draft / published) or historic /// </summary> /// <param name="resourceId">The id of the resource</param> /// <exception cref="EntityNotFoundException">If no entity found in active and historic graphs</exception> /// <returns></returns> private Resource GetResourceById(string resourceId) { Resource resource; // Instead of checking for resource existing in one graph first, this minimizes calls to database try { resource = _resourceService.GetById(resourceId); } catch (EntityNotFoundException) { resource = _historicResourceService.GetHistoricResource(resourceId); } return(resource); }
public IActionResult GetHistoricResource([FromQuery] string pidUri, [FromQuery] string id) { var result = _historicResourceService.GetHistoricResource(pidUri, id); return(Ok(result)); }