🥅 catching 'No Content' error
Co-authored-by: haraldnilsen <harald_998@hotmail.com>
This commit is contained in:
		
							parent
							
								
									6ef2a4f8af
								
							
						
					
					
						commit
						a2557d2201
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		|  | @ -29,6 +29,10 @@ public class MovieController: ControllerBase | |||
|             IEnumerable<MovieDB> resultSkip = movies.Skip(pageSize * (pageNumber - 1)); | ||||
|             IEnumerable<MovieDB> resultTake = resultSkip.Take(pageSize); | ||||
| 
 | ||||
|             if (resultTake.ToList().Count == 0) { | ||||
|                 return StatusCode(204, "No Content"); | ||||
|             } | ||||
| 
 | ||||
|             return Ok(resultTake); | ||||
|         } | ||||
|     catch (Exception ex) | ||||
|  |  | |||
		Reference in a new issue
	
	 Sindre Kjelsrud
						Sindre Kjelsrud