title: put operations CRUD on a single file in asp.net
body: <p>**Hello
  I am developing an application with ASP.NET API, i created the controller entity and the MVC controllers that my generated CRUD operations in the view as follows (see picture), each operation in a file how to put it all in a single file.</p>
  
  <p>**
   <a href="https://i.stack.imgur.com/DVowj.png" rel="nofollow noreferrer">enter image description here</a>
  controller code:</p>
  
  <pre><code>    // GET: /Clients/
  public ActionResult Index()
  {
      return View(db.CLIENT.ToList());
  }
  
  // GET: /Clients/Details/5
  public ActionResult Details(long? id)
  {
      if (id == null)
      {
          return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
      }
      Client_H Client_H = db.Client_H.Find(id);
      if (Client_H == null)
      {
          return HttpNotFound();
      }
      return View(Client_H);
  }
  
  // GET: /Clients/Create
  public ActionResult Create()
  {
      return View();
  }
  
  // POST: /Clients/Create
  // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
  // more details see http://go.microsoft.com/fwlink/?LinkId=317598.
  [HttpPost]
  [ValidateAntiForgeryToken]
  public ActionResult Create([Bind(Include="ID,nom,prenom,CODE,ADRESSE,BQE_VILLE,ADRESSE,TEL")] Client_H Client_H)
  {
      if (ModelState.IsValid)
      {
          db.Client_H.Add(Client_H);
          db.SaveChanges();
          return RedirectToAction("Index");
      }
  
      return View(Client_H);
  }
  
  // GET: /Clients/Edit/5
  public ActionResult Edit(long? id)
  {
      if (id == null)
      {
          return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
      }
      Client_H Client_H = db.Client_H.Find(id);
      if (Client_H == null)
      {
          return HttpNotFound();
      }
      return View(Client_H);
  }
  
  // POST: /Clients/Edit/5
  // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
  // more details see http://go.microsoft.com/fwlink/?LinkId=317598.
  [HttpPost]
  [ValidateAntiForgeryToken]
  public ActionResult Edit([Bind(Include="ID,nom,prenom,CODE,ADRESSE,BQE_VILLE,ADRESSE,TEL")] Client_H Client_H)
  {
      if (ModelState.IsValid)
      {
          db.Entry(Client_H).State = EntityState.Modified;
          db.SaveChanges();
          return RedirectToAction("Index");
      }
      return View(Client_H);
  }
  
  // GET: /Clients/Delete/5
  public ActionResult Delete(long? id)
  {
      if (id == null)
      {
          return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
      }
      Client_H Client_H = db.Client_H.Find(id);
      if (Client_H == null)
      {
          return HttpNotFound();
      }
      return View(Client_H);
  }
  
  // POST: /Clients/Delete/5
  [HttpPost, ActionName("Delete")]
  [ValidateAntiForgeryToken]
  public ActionResult DeleteConfirmed(long id)
  {
      Client_H Client_H = db.Client_H.Find(id);
      db.Client_H.Remove(Client_H);
      db.SaveChanges();
      return RedirectToAction("Index");
  }
  
  protected override void Dispose(bool disposing)
  {
      if (disposing)
      {
          db.Dispose();
      }
      base.Dispose(disposing);
  }
  </code></pre>
  
  <p>}</p>
  
  <p><strong>Thank you in advance</strong></p>