You are developing an application that implements a set of custom exception types. You declare the custom exception types by using the following code segments:
public class AdventureWorksException : System.Exception {...}
public class AdventureWorksDbException : AdventureWorksException {...}
public class AdventureWorksValidationException : p AdventureWorksException {...}
The application includes a function named DoWork that throws .NET Framework exceptions and custom exceptions.The application contains only the following logging methods:
static void Log (Exception ex) {...}
static void Log (AdventureWorksException ex) {...}
static void Log (AdventureWorksValidationException ex) {...}
The application must meet the following requirements:
- When AdventureWorksValidationException exceptions are caught, log the information by using the static void Log (AdventureWorksValidationException ex) method.
- When AdventureWorksDbException or other AdventureWorksException exceptions are caught, log the information by using the static void I oq( AdventureWorksException ex) method.
How should you complete the relevant code to meet the requirements?
try{
_____DoWork();
}
catch (❌){
_____Log(ex);
}
catch (❌){
_____Log(ex);
}
catch (❌ ex){
_____Log(ex);
}
Drag and drop to complete the text.
AdventureWorksValidationException ex
AdventureWorksValidationException ex
ContosoDbException ex
ContosoDbException ex
AdventureWorksException ex
AdventureWorksException ex