Пример #1
0
 public Login(IDataAccess _dataAccess,
              IExceptionHandling _exceptionHandling,
              IConfiguration _configurationManager)
 {
     dataAccess           = _dataAccess;
     exceptionHandling    = _exceptionHandling;
     configurationManager = _configurationManager;
 }
Пример #2
0
 private static Task HandleExceptionAsync(HttpContext context, Exception exception)
 {
     try
     {
         _exceptionHandling = VerificarTipoExcecao(exception, context);
         var errorHandling = _exceptionHandling.TratarErro(exception);
         context.Response.StatusCode  = errorHandling.ErrorCode;
         context.Response.ContentType = "application/json";
         return(context.Response.WriteAsync(JsonConvert.SerializeObject(errorHandling.ErrorObject)));
     }
     catch (Exception ex)
     {
         return(context.Response.WriteAsync(JsonConvert.SerializeObject(new
         {
             Message = "Problemas no sistema. Entre em contato com o administrador do sistema.",
             Stack = ex.ToString()
         })));
     }
 }
Пример #3
0
 public DbConnectionHelper(IExceptionHandling exception,
                           IConfiguration config)
 {
     exceptionHandling = exception;
     configuration     = config;
 }
Пример #4
0
 public Reference(IDataAccess access, IExceptionHandling exception)
 {
     dataAccess        = access;
     exceptionHandling = exception;
 }
 public Milestone(IDataAccess access, IExceptionHandling exception, ILogin loginDetails)
 {
     dataAccess        = access;
     exceptionHandling = exception;
     login             = loginDetails;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="exception">Exception handling class to log exceptions</param>
 /// <param name="connectionHelper">Connection helper to abstract connection provider</param>
 public DataAccess(IExceptionHandling exception, IDbConnectionHelper connectionHelper)
 {
     exceptionHandling  = exception;
     dbConnectionHelper = connectionHelper;
 }
 public CodeTables(IDataAccess access, IExceptionHandling exception)
 {
     dataAccess        = access;
     exceptionHandling = exception;
 }
 public Provider(IDataAccess _dataAccess, IExceptionHandling _exceptionHandling)
 {
     dataAccess        = _dataAccess;
     exceptionHandling = _exceptionHandling;
 }
 public CashoutService(IDataAccess access, IExceptionHandling exception)
 {
     dataAccess        = access;
     exceptionHandling = exception;
 }
 public Invoice(IDataAccess access, IExceptionHandling exception)
 {
     dataAccess        = access;
     exceptionHandling = exception;
 }
 public ProgramRequest(IDataAccess access, IExceptionHandling exception)
 {
     dataAccess        = access;
     exceptionHandling = exception;
 }