Exemple #1
0
 public ExampleMessage(Message entity, ExampleTopic topic)
 {
     Id           = entity.Id;
     Text         = entity.Text;
     CreatedDate  = entity.CreatedDate;
     ModifiedDate = entity.ModifiedDate;
     Author       = entity.Author;
     IsMine       = ExampleContext.Current.User != null && ExampleContext.Current.User.Id == entity.AuthorId;
     TopicId      = topic.Id;
     Topic        = topic;
 }
 public ExampleMessage(Message entity, ExampleTopic topic)
 {
     Id = entity.Id;
     Text = entity.Text;
     CreatedDate = entity.CreatedDate;
     ModifiedDate = entity.ModifiedDate;
     Author = entity.Author;
     IsMine = ExampleContext.Current.User != null && ExampleContext.Current.User.Id == entity.AuthorId;
     TopicId = topic.Id;
     Topic = topic;
 }
        public ActionResult Create(int id)
        {
            var section = _sectionService.Find(id);
            if (section == null)
            {
                return HttpNotFound();
            }

            var topic = new ExampleTopic
            {
                Status = TopicStatus.Draft,
                SectionId = section.Id,
                Section = section
            };

            return View(topic);
        }