public async Task <IActionResult> Edit(int id, [Bind("CollectorId,ItemId")] CollectionObj collectionObj) { if (id != collectionObj.CollectorId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(collectionObj); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CollectionObjExists(collectionObj.CollectorId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CollectorId"] = new SelectList(_context.Collector, "CollectorId", "CollectorId", collectionObj.CollectorId); ViewData["ItemId"] = new SelectList(_context.Item, "ItemId", "ItemId", collectionObj.ItemId); return(View(collectionObj)); }
public void CommitSnapshot() { if (_collection != null) { CollectionObj.CommitSnapshot(); } }
public void RevertToPreviousState() { if (_collection != null) { CollectionObj.RevertToPreviousState(); } }
public void CreateSnapshot() { // Delegate the call to the collection itself; if the collection is not // loaded yet, it will be loaded now. // If the collection is not loaded yet, we do not want to create the snapshot. if (_collection != null) { CollectionObj.CreateSnapshot(); } }
public async Task <IActionResult> Create([Bind("CollectorId,ItemId")] CollectionObj collectionObj) { if (ModelState.IsValid) { _context.Add(collectionObj); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CollectorId"] = new SelectList(_context.Collector, "CollectorId", "CollectorId", collectionObj.CollectorId); ViewData["ItemId"] = new SelectList(_context.Item, "ItemId", "ItemId", collectionObj.ItemId); return(View(collectionObj)); }
public virtual void Init(GameObject owner) { if (owner == null) { return; } Owner = owner; SetBindNode(Owner, BIND_NAME); CollectionObj obj = Owner.GetComponent <CollectionObj>(); if (obj == null) //测试时 { NameText.text = "test"; return; } NameText.text = obj.Name; }
public void ClearDeleted() { CollectionObj.ClearDeleted(); }
public void RemoveAt(int index) { CollectionObj.RemoveAt(index); }
public ReadOnlyCollection <T> AsReadOnly() { return(CollectionObj.AsReadOnly()); }
public T[] ToArray() { return(CollectionObj.ToArray()); }
public void Remove(T item) { CollectionObj.Remove(item); }
public void Insert(int index, T item) { CollectionObj.Insert(index, item); }
public void Add(T item) { CollectionObj.Add(item); }