public async Task <bool> Handle(CreateSalaryPermanentCommand request, CancellationToken cancellationToken) { var salary = new Dmoain.AggregatesModel.SalaryAggregate.salary(request.EmpId, request.Salary); _Repository.Add(salary); return(await _Repository.UnitOfWork.SaveEntitiesAsync(cancellationToken)); }
public async Task Handle(EmployeePermanentCreatedIntegrationEvent @event) { using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}")) { // _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); var empsalary = new salary(@event.EmpId, 1000.00); _repository.Add(empsalary); await _repository.UnitOfWork .SaveEntitiesAsync(); } }
public async Task Handle(SalaryAccordingDayDomainEvent notification, CancellationToken cancellationToken) { var NumOfDays = notification.attendance.days; var SalaryFromEvent = Int32.Parse(NumOfDays) * 150; var Salary = new Salary.Dmoain.AggregatesModel.SalaryAggregate.salary(1, SalaryFromEvent); SalaryRepository.Add(Salary); }
public async Task Handle(SalaryAccordingDayDomainEvent notification, CancellationToken cancellationToken) { var NumOfDays = notification.attendance.days; var salaryFromEvent = Convert.ToDecimal(NumOfDays) * 150; var salary = new Salary.Dmoain.AggregatesModel.EmployeeAggregate.Salary(1, salaryFromEvent); salaryRepository.Add(salary); }
public RedirectToActionResult Create(Salary employee) { Salary newEmployee = new Salary { Amount = employee.Amount, Department = employee.Department, Type = employee.Type, }; _empRepo.Add(newEmployee); return(RedirectToAction("AllDetails")); }