Exemplo n.º 1
0
        public void Will_be_able_to_save_and_retrieve_a_client_dto()
        {
            var clientDto = new ClientReport(Guid.NewGuid(), "Mark Nijhof");
            _repository.Save(clientDto);
            var sut = _repository.GetByExample<ClientReport>(new {Name = "Mark Nijhof"}).FirstOrDefault();

            Assert.That(sut.Id, Is.EqualTo(clientDto.Id));
            Assert.That(sut.Name, Is.EqualTo(clientDto.Name));
        }
Exemplo n.º 2
0
 public virtual ActionResult Save(ClientReport client)
 {
     try
     {
         if (ModelState.IsValid)
         {
             PublishAndCommit(new ChangeClientNameCommand(client.Id, client.Name));
             return RedirectToAction(MVC.Client.List.Show());
         }
     }
     catch (Exception ex)
     {
         ReportError(ex.Message);
     }
     return View(Views.Show, client);
 }