示例#1
0
        public async Task <SaveSizeRes> Save(SaveSizeReq request)
        {
            var result = new SaveSizeRes()
            {
                SizeId  = 0,
                Message = "Something went wrong, please contact administrator."
            };

            try
            {
                DynamicParameters parameters = new DynamicParameters();
                parameters.Add("@SizeId", request.SizeId);
                parameters.Add("@SizeName", request.SizeName);
                result = await SqlMapper.QueryFirstOrDefaultAsync <SaveSizeRes>(cnn : connection,
                                                                                sql : "sp_SaveSize",
                                                                                param : parameters,
                                                                                commandType : CommandType.StoredProcedure
                                                                                );

                return(result);
            }
            catch (Exception e)
            {
                return(result);
            }
        }
示例#2
0
 public async Task <SaveSizeRes> Save(SaveSizeReq request)
 {
     return(await sizeRepository.Save(request));
 }
示例#3
0
        public async Task <OkObjectResult> SaveSize(SaveSizeReq request)
        {
            var result = await sizeService.Save(request);

            return(Ok(result));
        }