Check if item exists I have a service to Insert TagName , I dont want to insert duplicate tags
I used this :

   public void Insert(string tagName)
    {
        tagName = tagName.Trim();

        if (IsExists(tagName))
            throw new ArgumentException("tagName is Exists");
        Tag model = new Tag { Name=tagName};

        _uow.MarkAsAdded(model);

    }

    public bool IsExists(string tagName)
    {
        return _tags.Any(row=&gt;row.Name==tagName.Trim());
    }


and another way is change If statement like below :

  public void Insert(string tagName)
    {
        tagName = tagName.Trim();

        if (!IsExists(tagName))
        {
            Tag model = new Tag { Name = tagName };
            _uow.MarkAsAdded(model);
        }
    }


I decided to use second one because I add another method Like this :

  public void Insert(string[] tags)
    {
        foreach (var item in tags)
        {
            Insert(item);
        }
    }


If I throw exception , Insert(string[] tags) will not completed .

Updated:

 private readonly IDbSet&lt;Tag&gt; _tags;

      #region ctor

    public TagService(IUnitOfWork uow)
    {
        _uow = uow;
        _tags = _uow.Set&lt;Tag&gt;();

    }

    #endregion
You make this harder then it needs to be.

Since IDbSet implements the IEnumerable&lt;TEntity&gt; interface


 public interface IDbSet&lt;TEntity&gt; 
 : IQueryable&lt;TEntity&gt;, IEnumerable&lt;TEntity&gt;, IQueryable, IEnumerable



you can simply use the Contains extension optionally with your own comparer that can implement such things as Trim etc.