Exemplo n.º 1
0
        public async Task <dynamic> Dispatch(AddNewExpenseMessage message, Configurations configurations)
        {
            using var context = new FinancialControlDataContext(configurations.DataConnectionString);

            var dataAccess = new AddNewExpenseDataAccess(context);
            var handler    = new AddNewExpenseMessageHandler(dataAccess);

            return(await handler.Execute(message));
        }
Exemplo n.º 2
0
        public async Task <dynamic> Dispatch(GetUserFinancialInformationMessage message, Configurations configurations)
        {
            using var context      = new FinancialControlDataContext(configurations.DataConnectionString);
            using var dbConnection = new SqlConnection(configurations.DataConnectionString);

            var handler = new GetUserFinancialInformationMessageHandler(dbConnection);

            return(await handler.Execute(message));
        }
Exemplo n.º 3
0
        public async Task <dynamic> Dispatch(DeleteIncomeMessage message, Configurations configurations = null)
        {
            using var context      = new FinancialControlDataContext(configurations.DataConnectionString);
            using var dbConnection = new SqlConnection(configurations.DataConnectionString);

            var dataAccess = new DeleteIncomeDataAccess(context, dbConnection);

            return(await new DeleteIncomeMessageHandler(dataAccess).Execute(message));
        }
Exemplo n.º 4
0
 public RemoveIncomeDataAccess(FinancialControlDataContext context)
 {
     this._context = context ?? throw new ArgumentNullException(nameof(context));
 }
Exemplo n.º 5
0
 public DeleteIncomeDataAccess(FinancialControlDataContext context, IDbConnection dbConnection)
 {
     this._context      = context ?? throw new ArgumentNullException(nameof(context));
     this._dbConnection = dbConnection ?? throw new ArgumentNullException(nameof(dbConnection));
 }
Exemplo n.º 6
0
 public EditExpenseDataAccess(FinancialControlDataContext context)
 {
     this._context = context ?? throw new ArgumentNullException(nameof(context));
 }