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

GetNewContents() public static method

public static GetNewContents ( IEnumerable dbContents, IEnumerable clientContents, int userId ) : List
dbContents IEnumerable
clientContents IEnumerable
userId int
return List
        public static List<PostContent> GetNewContents(IEnumerable<PostContent> dbContents, IEnumerable<PostContent> clientContents, int userId)
        {
            var newContents = (from c in clientContents
                where dbContents.All(a => a.MediaId != c.MediaId)
                select c).ToList();

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

            return newContents;
        }
    }