Almost all my codes in C# are something like this:
try
{
response = SomeMethod(requestModel);
}
catch (Exception ex)
{
this.logger.Log(ex.MoreDetails());
response = this.BadRequest();
}
the SomeMethod is the only thing that is different, but all the request models inherit some parent model. Any tips so I don't have to keep repeating this on all my codes? The response also use the same generic model.