コード例 #1
0
 public ActionResult Create([Bind(Include = "ID, Title, Contact")] Client client)
 {
     if (ModelState.IsValid)
     {
         clients.Add(client);
         return(RedirectToAction("Index"));
     }
     return(View());
 }
コード例 #2
0
 public void Execute()
 {
     try
     {
         ClientRepo.Add(Entity);
         Scope.Complete();
     }
     catch (NullReferenceException e)
     {
         Rollback();
         throw e;
     }
     catch (TransactionException e)
     {
         Rollback();
         throw new InvalidOperationException("Add entity faild ", e);
     }
 }