예제 #1
0
        public async Task <SlideDto> CreateUploadFile(IFormFile file, string title, string detail, float price)
        {
            UploadFile upload   = new UploadFile();
            string     fileName = upload.ImageUpload(file, _iHostEnvironment);
            var        slide    = new Slide
            {
                Name   = fileName,
                Title  = title,
                Detail = detail,
                Sale   = price
            };
            await _slideRepository.InsertAsync(slide);

            return(ObjectMapper.Map <Slide, SlideDto>(slide));
        }