Blog.DataAccess.Database.Repository.RepositoryHelper.GetNewTags C# (CSharp) Method

GetNewTags() public static method

public static GetNewTags ( IEnumerable dbTags, IEnumerable clientTags, int userId ) : List
dbTags IEnumerable
clientTags IEnumerable
userId int
return List
        public static List<Tag> GetNewTags(IEnumerable<Tag> dbTags, IEnumerable<Tag> clientTags, int userId)
        {
            var dbTagNames = dbTags.Select(a => a.TagName.ToLower()).ToList();
            var newTags = (from t in clientTags
                where dbTagNames.All(a => a != t.TagName)
                select t).ToList();

            foreach (var t in newTags)
            {
                t.CreatedDate = DateTime.Now;
                t.CreatedBy = userId;
                t.ModifiedDate = DateTime.Now;
                t.ModifiedBy = userId;
            }

            return newTags;
        }