/// <summary> /// Create a new Article object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="title">Initial value of the Title property.</param> public static Article CreateArticle(global::System.Int32 id, global::System.String title) { Article article = new Article(); article.Id = id; article.Title = title; return article; }
private void InitArticleMemoryRepository() { IRepository<Article> memoryArticlesRepository = _memoryFactory .Begin() .UsingContainer<NoteworthyEFEntities>() .GetRepository(container => container.Articles); Topic ddd = new Topic() { TopicName = "ddd" }; Topic corresopndence = new Topic() { TopicName = "correspondence" }; Article efRepository = new Article() { Title = "Entity Framework and the Repository Pattern" }; efRepository.Topics.Add(ddd); Article correspondenceLaunch = new Article() { Title = "Correspondence Launch" }; correspondenceLaunch.Topics.Add(corresopndence); Article correspondenceDDD = new Article() { Title = "Correspondence and DDD" }; correspondenceDDD.Topics.Add(ddd); correspondenceDDD.Topics.Add(corresopndence); memoryArticlesRepository.Add(efRepository); memoryArticlesRepository.Add(correspondenceLaunch); memoryArticlesRepository.Add(correspondenceDDD); }
/// <summary> /// Deprecated Method for adding a new object to the Articles EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToArticles(Article article) { base.AddObject("Articles", article); }