コード例 #1
0
 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
 }
コード例 #2
0
        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);
        }
コード例 #3
0
 public void SetIdForResource(object resource, string id)
 {
     IdProperty.SetValue(resource, id); // TODO: handle classes with non-string ID types
 }