예제 #1
0
        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
            });
        }
예제 #2
0
        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));
        }
예제 #3
0
 public Slide Create(Slide slide)
 {
     return(_slideRepository.Add(slide));
 }
예제 #4
0
 public void Add(Slide slide)
 {
     _slideRepository.Add(slide);
 }
예제 #5
0
 public Slide Add(Slide slidepage)
 {
     return(_slideRepository.Add(slidepage));
 }
예제 #6
0
 public async Task Add(SlideViewModel pageVm)
 {
     var page = new SlideViewModel().Map(pageVm);
     await _slideRepository.Add(page);
 }
예제 #7
0
 public Slide Add(Slide Slide)
 {
     return(_slideRepository.Add(Slide));
 }
예제 #8
0
 public void CreateSlide(Slide slide)
 {
     slideRepository.Add(slide);
 }
예제 #9
0
        public void AddSlide(SlideViewModel slideViewModel)
        {
            var slide = Mapper.Map <SlideViewModel, Slide>(slideViewModel);

            _slideRepository.Add(slide);
        }
예제 #10
0
 public void Add(Slide Slide)
 {
     SlideRepository.Add(Slide);
 }
 public Slide Insert(Slide entity)
 {
     return(_SlideRepository.Add(entity));
 }