public async Task <MessageModel <int> > Post([FromBody] Slide Slide) { if (Slide == null) { return(new MessageModel <int>() { msg = "参数异常", response = 0 }); } var blogId = await _slideRepository.Add(Slide); return(new MessageModel <int>() { msg = "添加成功", success = true, response = blogId }); }
public async Task <IActionResult> ExecuteAsync(SaveSlide saveSlide, CancellationToken cancellationToken) { var slide = _saveSlideToSlideMapper.Map(saveSlide); //var user = _httpContextAccessor.HttpContext.User; //if (user == null) // return new NotFoundResult(); //var claims = user.Claims.ToList(); //if (claims.Count < 1) // return new NotFoundResult(); //// Lấy Id của người dùng //var userId = claims.FirstOrDefault(claimRecord => claimRecord.Type == "sub")?.Value; //slide.CreatedBy = userId; //slide.ModifiedBy = userId; slide = await _slideRepository.Add(slide, cancellationToken); var slideViewModel = _slideToSlideMapper.Map(slide); return(new OkObjectResult(slideViewModel)); }
public Slide Create(Slide slide) { return(_slideRepository.Add(slide)); }
public void Add(Slide slide) { _slideRepository.Add(slide); }
public Slide Add(Slide slidepage) { return(_slideRepository.Add(slidepage)); }
public async Task Add(SlideViewModel pageVm) { var page = new SlideViewModel().Map(pageVm); await _slideRepository.Add(page); }
public Slide Add(Slide Slide) { return(_slideRepository.Add(Slide)); }
public void CreateSlide(Slide slide) { slideRepository.Add(slide); }
public void AddSlide(SlideViewModel slideViewModel) { var slide = Mapper.Map <SlideViewModel, Slide>(slideViewModel); _slideRepository.Add(slide); }
public void Add(Slide Slide) { SlideRepository.Add(Slide); }
public Slide Insert(Slide entity) { return(_SlideRepository.Add(entity)); }