public void SetIdForResource(object resource, string id) { if (resource == null) { throw new ArgumentNullException(nameof(resource)); } IdProperty.SetValue(resource, id); // TODO: handle classes with non-string ID types }
public void SetId(object instance, Guid id) { if (instance == null) { throw new NullReferenceException("SetId cannot be called on a null instance"); } IdProperty.SetValue(instance, id); }
public void SetIdForResource(object resource, string id) { IdProperty.SetValue(resource, id); // TODO: handle classes with non-string ID types }