示例#1
0
 /// <summary>
 /// Asserts that the given entity can be stored in the collection.
 /// </summary>
 /// <param name="entity"></param>
 protected void AssertEntity(object entity)
 {
     if (entity == null)
     {
         throw new ArgumentNullException("entity");
     }
     if (this.IsStrongCollection == true)
     {
         this.EntityType.AssertIsOfType(entity);
     }
     else
     {
         EntityType.AssertIsEntity(entity);
     }
 }