public void Publish(Article article) { article.PostedDate = DateTime.Now; article.Disciplines = disciplineStorage.Get( article.Disciplines.Select(x => x.Id)).ToList(); articleStorage.Add(article); }
public void Ask(Question question) { question.Disciplines = disciplineStorage.Get( question.Disciplines.Select(x => x.Id)).ToList(); question.PostedDate = DateTime.Now; questionStorage.Add(question); }
private static IEnumerable<Discipline> SelectDisciplines( IDisciplineStorage storage) { yield return storage.Get(2); yield return storage.Get(5); yield return storage.Get(3); yield return storage.Get(8); yield return storage.Get(4); yield return storage.Get(11); yield return storage.Get(14); }
private static IEnumerable <Discipline> SelectDisciplines( IDisciplineStorage storage) { yield return(storage.Get(2)); yield return(storage.Get(5)); yield return(storage.Get(3)); yield return(storage.Get(8)); yield return(storage.Get(4)); yield return(storage.Get(11)); yield return(storage.Get(14)); }
public void Subscribe(int userId, IEnumerable <int> disciplineIds) { var disciplines = disciplineStorage.Get(disciplineIds); userStorage.UpdateDisciplines(userId, disciplines.Select(x => x.Id)); }