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); } }
public async Task <SaveSizeRes> Save(SaveSizeReq request) { return(await sizeRepository.Save(request)); }
public async Task <OkObjectResult> SaveSize(SaveSizeReq request) { var result = await sizeService.Save(request); return(Ok(result)); }