Пример #1
0
        public ActionResult Topics(int id)
        {
            Topic   topic   = _chapterService.GetTopicById(id);
            TopicVM topicVM = Mapper.Map <Topic, TopicVM>(topic);

            var res = JsonConvert.SerializeObject(topic, new JsonSerializerSettings
            {
                ContractResolver      = new CamelCasePropertyNamesContractResolver(),
                ReferenceLoopHandling = ReferenceLoopHandling.Ignore
            });

            return(Content(res, "application/json"));
        }