public NewsContent AddContent(string language, string title, string text)
        {
            if (this.Content.Any(x => x.Language == language))
            {
                throw new DomainException(ErrorCode.DuplicateNewsContent, "There is already news content for the given language");
            }

            var newsContent = new NewsContent(language, title, text);

            this.Content.Add(newsContent);

            return newsContent;
        }
示例#2
0
        public NewsContent AddContent(string language, string title, string text)
        {
            if (this.Content.Any(x => x.Language == language))
            {
                throw new DomainException(ErrorCode.DuplicateNewsContent, "There is already news content for the given language");
            }

            var newsContent = new NewsContent(language, title, text);

            this.Content.Add(newsContent);

            return(newsContent);
        }