public ActionResult Create(ClientViewModel clientViewModel)
 {
     if (ModelState.IsValid)
     {
         try
         {
             var client = new Client
             {
                 Name = clientViewModel.Name,
                 Mail = clientViewModel.Mail,
                 Id = clientViewModel.Id
             };
             var identity = _service.Save(client);
             return RedirectToAction("View", new {id = identity});
         }
         catch (Exception)
         {
             throw;
         }
     }
     return View(clientViewModel);
 }
 public ActionResult View(int id)
 {
     var client = _service.GetById(id);
     var clientVm = new ClientViewModel(client);
     return View(clientVm);
 }
 public ActionResult Index()
 {
     var orderList = _service.GetAll();
     var viewModel = new ClientViewModel();
     return View(viewModel.GetListViewModel(orderList));
 }
 public ActionResult Edit(int id)
 {
     var client = _service.GetById(id);
     var viewModel = new ClientViewModel(client);
     return View("Create", viewModel);
 }