Exemple #1
0
        public async Task <SaveImageRes> Save(SaveImageReq saveImageReq)
        {
            SaveImageRes Result = new SaveImageRes();

            try
            {
                DynamicParameters parameters = new DynamicParameters();
                parameters.Add("@ImageId", saveImageReq.ImageId);
                parameters.Add("@ImagePath", saveImageReq.ImagePath);
                parameters.Add("@TypeOfRoomId", saveImageReq.TypeOfRoomId);


                Result = await SqlMapper.QueryFirstOrDefaultAsync <SaveImageRes>(cnn : connection,
                                                                                 sql : "sp_SaveImage",
                                                                                 param : parameters,
                                                                                 commandType : CommandType.StoredProcedure);

                return(Result);
            }
            catch (Exception)
            {
                return(Result);
            }
        }
Exemple #2
0
        public async Task <OkObjectResult> SaveImage(SaveImageReq saveImageReq)
        {
            var result = await imageService.Save(saveImageReq);

            return(Ok(result));
        }
 public async Task <SaveImageRes> Save(SaveImageReq saveImageReq)
 {
     return(await imageRepository.Save(saveImageReq));
 }