public async Task <IActionResult> GetAsync([FromRoute] Guid vlogId) { // Act. var vlog = await _vlogService.GetAsync(vlogId); // Map. VlogDto output = _mapper.Map <VlogDto>(vlog); // Return. return(Ok(output)); }
public async Task <IActionResult> UpdateAsync([FromRoute] Guid vlogId, [FromBody] VlogDto input) { // Map. var vlog = _mapper.Map <Vlog>(input); vlog.Id = vlogId; // Act. await _vlogService.UpdateAsync(vlog); // Return. return(NoContent()); }
public IActionResult PostVlog([FromServices] DispatchManager dispatchManager, [FromServices] Core.AppContext appContext, [FromBody] VlogDto input) { // Act. var postVlogContext = new PostVlogContext { IsPrivate = input.IsPrivate, UserId = appContext.UserId, VlogId = input.Id, }; dispatchManager.Dispatch <PostVlogBackgroundTask>(postVlogContext); // Return. return(NoContent()); }