/// <summary> /// Converts a JSON entity ID object to an EntityRef /// </summary> /// <param name="objId">The object identifier.</param> /// <returns></returns> private EntityRef ConvertId(string objId) { var entityRef = new EntityRef(objId); try { // Attempt to resolve the Id entityRef.ResolveId( ); } catch (ArgumentException) { return(null); // or whatever } return(entityRef); }