public bool TryGetByAlias <T>(string alias, out Aliased <T> item) where T : class { IAliased i; if (aliases.TryGetValue(alias, out i)) { item = i as Aliased <T>; return(item != null); } item = null; return(false); }
public Aliased <T> SetAlias <T>(string alias, T item) { if (item == null) { throw new ArgumentNullException(nameof(item)); } if (String.IsNullOrEmpty(alias)) { throw new ArgumentNullException(nameof(alias)); } var aliased = new Aliased <T>(alias, item); aliases[alias] = aliased; return(aliased); }