Beispiel #1
0
 public ActionResult AddEmployee(CreateEmployeeCommand command)
 {
     try
     {
         command.EmployeeId = Guid.NewGuid();
         _service.Handle(command);
         return Json(new { Succeeded = true });
     }
     catch (Exception ex)
     {
         return
             Json(
                 new
                 {
                     Succeeded = false,
                     ErrorMessage = string.Format("Something went bad...oops: {0}", ex.Message)
                 });
     }
 }
Beispiel #2
0
        public void Handle(CreateEmployeeCommand command)
        {
            var employee = new Employee(command.EmployeeId, command.Name, command.Address);

            _repo.Save(employee);
        }
Beispiel #3
0
        public void Handle(CreateEmployeeCommand command)
        {
            var employee = new Employee(command.EmployeeId, command.Name, command.Address);

            _repo.Save(employee);
        }