In ASP.NET MVC Boilerplate API Controllers generating from Application Services dynamically. For example I need to throw an exception before request go into the action/method. How handle request? Thanks!
public class UserAppService : PlatformAppServiceBase, IUserAppService
{
private readonly IRepository<User, long> _userRepository;
public UserAppService(IRepository<User, long> userRepository)
{
_userRepository = userRepository;
}
// handle request before request executes this action
public async Task<ListResultOutput<UserDto>> GetUsers()
{
var users = await _userRepository.GetAllListAsync();
return new ListResultOutput<UserDto>(users.MapTo<List<UserDto>>());
}
}