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; }
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); }