public SalaryEntry CreateSalaryEntry(SalaryEntryCreateDefinition salaryEntryCreateDefinition)
        {
            var user = _unitOfWork.UserRepository.GetById(salaryEntryCreateDefinition.UserId);

            if (user == null)
            {
                throw new UserNotFoundException(salaryEntryCreateDefinition.UserId);
            }

            var domain = new SalaryEntry
                         (
                0,
                salaryEntryCreateDefinition.UserId,
                salaryEntryCreateDefinition.Date,
                salaryEntryCreateDefinition.Amount,
                salaryEntryCreateDefinition.Rate,
                DateTime.Now,
                DateTime.Now
                         );

            domain = _unitOfWork.SalaryEntryRepository.Create(domain);

            _unitOfWork.SaveChanges();

            return(domain);
        }
 public static Domain.Entities.SalaryEntry ToDomain(SalaryEntry entity)
 {
     return(MapperInstance.Map <SalaryEntry, Domain.Entities.SalaryEntry>(entity));
 }