public virtual void AddKey(DbResourceKey key) { if (keys.Contains(key)) { return; } keys.Add(key); key.Resource = this; }