public bool Create(int id) { Console.Write("Enter Comment: "); var content = Console.ReadLine(); Console.WriteLine(); Console.Write("Enter User Name: "); var user = Console.ReadLine(); var document = new CommentDocument {Id = id, Message = content, UserName = user, State = WorkflowState.Create}; _repository.Add(document); _repository.Save(); return true; }
public DocumentContext(int id, IRepository repository) { _repository = repository; _commentDocument = repository.SingleOrDefault<CommentDocument>(p => p.Id == id); }