public void Will_be_able_to_save_and_retrieve_a_client_details_dto()
        {
            var clientDetailsDto = new ClientDetailsReport(Guid.NewGuid(), "Mark Nijhof", "Street", "123", "5006", "Bergen", "123456789");
            _repository.Save(clientDetailsDto);
            var sut = _repository.GetByExample<ClientDetailsReport>(new {ClientName = "Mark Nijhof"}).FirstOrDefault();

            Assert.That(sut.Id, Is.EqualTo(clientDetailsDto.Id));
            Assert.That(sut.ClientName, Is.EqualTo(clientDetailsDto.ClientName));
            Assert.That(sut.Street, Is.EqualTo(clientDetailsDto.Street));
            Assert.That(sut.StreetNumber, Is.EqualTo(clientDetailsDto.StreetNumber));
            Assert.That(sut.PostalCode, Is.EqualTo(clientDetailsDto.PostalCode));
            Assert.That(sut.City, Is.EqualTo(clientDetailsDto.City));
            Assert.That(sut.PhoneNumber, Is.EqualTo(clientDetailsDto.PhoneNumber));
        }
 public virtual ActionResult Save(ClientDetailsReport client)
 {
     try
     {
         if (ModelState.IsValid)
         {
             PublishAndCommit(new ChangeClientPhoneNumberCommand(client.Id, client.PhoneNumber));
             return RedirectToAction(MVC.Client.Details.Show(client.Id));
         }
     }
     catch (Exception ex)
     {
         ReportError(ex.Message);
     }
     return View(Views.Show, client);
 }
 public virtual ActionResult Save(ClientDetailsReport client)
 {
     try
     {
         if (ModelState.IsValid)
         {
             PublishAndCommit(new ClientIsMovingCommand(client.Id, client.Street, client.StreetNumber, client.PostalCode, client.City));
             return RedirectToAction(MVC.Client.Details.Show(client.Id));
         }
     }
     catch (Exception ex)
     {
         ReportError(ex.Message);
     }
     return View(Views.Show, client);
 }
 public virtual ActionResult Save(ClientDetailsReport client)
 {
     try
     {
         ModelState["Id"].Errors.Clear();
         if (ModelState.IsValid)
         {
             var newClient = new CreateClientCommand(Guid.NewGuid(),
                                                     client.ClientName,
                                                     client.Street,
                                                     client.StreetNumber,
                                                     client.PostalCode,
                                                     client.City,
                                                     client.PhoneNumber);
             PublishAndCommit(newClient);
             return RedirectToAction(MVC.Client.List.Show());
         }
     }
     catch (Exception ex)
     {
         ReportError(ex.Message);
     }
     return View(Views.Show, client);
 }