no data exception and no documentation warnings in generated code
This commit is contained in:
10
DbService.cs
10
DbService.cs
@ -12,9 +12,10 @@ namespace de.hottis.genericdatabaseapiservice.Services {
|
||||
Task<List<TOUT>> ReadBySelect<TIN, TOUT>(string selectStatement, TIN input);
|
||||
}
|
||||
|
||||
public class DbServiceException : Exception {}
|
||||
public class NotDataFoundException : DbServiceException {}
|
||||
|
||||
public class DbService : IDbService {
|
||||
|
||||
|
||||
async public Task<List<TOUT>> ReadBySelect<TIN, TOUT>(string selectStatement, TIN input) {
|
||||
var itemList = new List<TOUT>();
|
||||
|
||||
@ -57,6 +58,11 @@ namespace de.hottis.genericdatabaseapiservice.Services {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (itemList.Count == 0) {
|
||||
throw new NotDataFoundException();
|
||||
}
|
||||
|
||||
return itemList;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user