示例#1
0
        // GET: Talks/Details/5
        public ActionResult Details(int id)
        {
            Talks          talk  = talkService.GetTalkById(id);
            TalksViewModel model = new TalksViewModel();

            model.InjectFrom(talk);
            return(View(talk));
        }
示例#2
0
        public IActionResult Edit(int?id)
        {
            TalkDto model = new TalkDto();

            if (id.HasValue)
            {
                var existingTalk = service.GetTalkById(id.Value);
                if (existingTalk != null)
                {
                    model = mapper.Map <TalkDto>(existingTalk);
                }
            }
            return(View(model));
        }
示例#3
0
        public async Task <IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Function, "get", Route = "Talk/{id}")] HttpRequest req,
            int id,
            ILogger log)
        {
            log.LogInformation($"Get Talk id {id}");

            var talk = await _talkService.GetTalkById(id);

            if (talk == null)
            {
                return(new NotFoundResult());
            }

            return(new OkObjectResult(talk));
        }
示例#4
0
 public IActionResult GetTalk(int id)
 {
     return(Ok(talkServices.GetTalkById(id)));
 }