public EnterpriseContextView CreateEnterpriseContextView(string key, string description) { AssertThatTheViewKeyIsUnique(key); EnterpriseContextView view = new EnterpriseContextView(Model, key, description); EnterpriseContextViews.Add(view); return(view); }
public EnterpriseContextView CreateEnterpriseContextView(string key, string description) { if (GetViewWithKey(key) != null) { throw new ArgumentException("A view with the key " + key + " already exists."); } else { EnterpriseContextView view = new EnterpriseContextView(Model, key, description); EnterpriseContextViews.Add(view); return(view); } }
private EnterpriseContextView FindEnterpriseContextView(EnterpriseContextView enterpriseContextView) { return(EnterpriseContextViews.FirstOrDefault(view => view.Key == enterpriseContextView.Key)); }