public void Update(Asset asset) { asset.Username = this._username; db.Assets.Attach(asset); db.Entry(asset).State = EntityState.Modified; db.SaveChanges(); }
public void Delete(Asset asset) { if (db.Entry(asset).State == EntityState.Detached) { db.Assets.Attach(asset); } db.Assets.Remove(asset); db.SaveChanges(); }
public ActionResult Create(Asset asset) { IAssetRepository repository = new EFAssetRepository(User.Identity.Name); if (ModelState.IsValid) { repository.Insert(asset); return RedirectToAction("Index"); } return View(asset); }
public void Insert(Asset asset) { asset.Username = this._username; db.Assets.Add(asset); db.SaveChanges(); }
public void Update(Asset asset) { throw new NotImplementedException(); }
public void Insert(Asset asset) { throw new NotImplementedException(); }
// // GET: /Asset/Create public ActionResult Create() { // return View(); Asset asset = new Asset(); return View(asset); }