@@ -59,8 +59,6 @@ public async Task<Result<FileDetails>> GetFile(String accessToken,
5959 Guid estateId ,
6060 Guid fileId ,
6161 CancellationToken cancellationToken ) {
62- FileDetails response = null ;
63-
6462 String requestUri = this . BuildRequestUrl ( $ "/api/files/{ fileId } ?estateId={ estateId } ") ;
6563
6664 try {
@@ -81,16 +79,14 @@ public async Task<Result<FileDetails>> GetFile(String accessToken,
8179 HandleResponseContent < FileDetails > ( result . Data ) ;
8280
8381 // call was successful so now deserialise the body to the response object
84- response = responseData . Data ;
82+ return Result . Success ( responseData . Data ) ;
8583 }
8684 catch ( Exception ex ) {
8785 // An exception has occurred, add some additional information to the message
8886 Exception exception = new Exception ( $ "Error getting file with Id { fileId } .", ex ) ;
8987
9088 throw exception ;
9189 }
92-
93- return Result . Success ( response ) ;
9490 }
9591
9692 /// <summary>
@@ -107,8 +103,6 @@ public async Task<Result<FileImportLog>> GetFileImportLog(String accessToken,
107103 Guid estateId ,
108104 Guid ? merchantId ,
109105 CancellationToken cancellationToken ) {
110- FileImportLog response = null ;
111-
112106 String requestUri = this . BuildRequestUrl ( $ "/api/fileImportLogs/{ fileImportLogId } ?estateId={ estateId } ") ;
113107
114108 if ( merchantId . HasValue ) {
@@ -133,16 +127,14 @@ public async Task<Result<FileImportLog>> GetFileImportLog(String accessToken,
133127 HandleResponseContent < FileImportLog > ( result . Data ) ;
134128
135129 // call was successful so now deserialise the body to the response object
136- response = responseData . Data ;
130+ return Result . Success ( responseData . Data ) ;
137131 }
138132 catch ( Exception ex ) {
139133 // An exception has occurred, add some additional information to the message
140134 Exception exception = new Exception ( "Error getting file import log." , ex ) ;
141135
142136 throw exception ;
143137 }
144-
145- return Result . Success ( response ) ;
146138 }
147139
148140 /// <summary>
@@ -161,8 +153,6 @@ public async Task<Result<FileImportLogList>> GetFileImportLogs(String accessToke
161153 DateTime endDateTime ,
162154 Guid ? merchantId ,
163155 CancellationToken cancellationToken ) {
164- FileImportLogList response = null ;
165-
166156 String requestUri =
167157 this . BuildRequestUrl (
168158 $ "/api/fileImportLogs?estateId={ estateId } &startDateTime={ startDateTime . Date : yyyy-MM-dd} &endDateTime={ endDateTime . Date : yyyy-MM-dd} ") ;
@@ -188,16 +178,14 @@ public async Task<Result<FileImportLogList>> GetFileImportLogs(String accessToke
188178 HandleResponseContent < FileImportLogList > ( result . Data ) ;
189179
190180 // call was successful so now deserialise the body to the response object
191- response = responseData . Data ;
181+ return Result . Success ( responseData . Data ) ;
192182 }
193183 catch ( Exception ex ) {
194184 // An exception has occurred, add some additional information to the message
195185 Exception exception = new Exception ( "Error getting list of file import logs." , ex ) ;
196186
197187 throw exception ;
198188 }
199-
200- return Result . Success ( response ) ;
201189 }
202190
203191 /// <summary>
@@ -214,7 +202,6 @@ public async Task<Result<Guid>> UploadFile(String accessToken,
214202 Byte [ ] fileData ,
215203 UploadFileRequest uploadFileRequest ,
216204 CancellationToken cancellationToken ) {
217- Guid response = Guid . Empty ;
218205 try {
219206 String requestUri = this . BuildRequestUrl ( "/api/files" ) ;
220207
@@ -246,16 +233,14 @@ public async Task<Result<Guid>> UploadFile(String accessToken,
246233 HandleResponseContent < Guid > ( result . Data ) ;
247234
248235 // call was successful so now deserialise the body to the response object
249- response = responseData . Data ;
236+ return Result . Success ( responseData . Data ) ;
250237 }
251238 catch ( Exception ex ) {
252239 // An exception has occurred, add some additional information to the message
253240 Exception exception = new Exception ( $ "Error uploading file { fileName } .", ex ) ;
254241
255242 throw exception ;
256243 }
257-
258- return Result . Success ( response ) ;
259244 }
260245
261246 /// <summary>
0 commit comments