/// <summary> /// Gets the item by the specified <paramref name="key"/>. /// </summary> /// <param name="key">The <see cref="UniqueKey"/>.</param> /// <returns>The item where found; otherwise, <c>null</c>.</returns> public TEntity GetByUniqueKey(UniqueKey key) { return(Items.Where(x => x.HasUniqueKey && key.Equals(x.UniqueKey)).FirstOrDefault()); }
/// <summary> /// Gets the item by the specified <paramref name="key"/>. /// </summary> /// <param name="key">The <see cref="UniqueKey"/>.</param> /// <returns>The item where found; otherwise, <c>null</c>.</returns> public TEntity GetByUniqueKey(UniqueKey key) { Check.NotNull(key, nameof(key)); return(Items.Where(x => x.HasUniqueKey && key.Equals(x.UniqueKey)).FirstOrDefault()); }