public Task <Item> UpdateItem(Guid id, Guid itemId, ModifiedItem item) { Player plr = players.Find(x => x.Id == id); Item itm = plr.items.Find(x => x.Id == itemId); itm.level = item.level; return(Task.FromResult(itm)); //throw new NotImplementedException(); }
public async Task <Item> UpdateItem(Guid id, Guid itemId, ModifiedItem item) { FilterDefinition <Player> filter = Builders <Player> .Filter.Eq("_id", id); Player plr = await _collection.Find(filter).FirstAsync(); Item itm = plr.items.Find(x => x.Id == itemId); itm.level = item.level; return(itm); }
public Task <Item> Modify(Guid playerid, Guid itemid, ModifiedItem Item) { return(repo.UpdateItem(playerid, itemid, Item)); }