public async Task <Item> ModifyItem(Guid playerid, Guid itemid, ModifiedItem item) { await Task.CompletedTask; Item found = GetItemById(playerid, itemid); if (found != null) { found.Level = item.Level; } return(found); }
public async Task <Item> ModifyItem(Guid playerid, Guid id, ModifiedItem item) { var filter = Builders <Player> .Filter.Eq("Id", playerid); var cursor = await collection.FindAsync(filter); Player player = cursor.First(); foreach (Item item2 in player.items) { if (item2.Id == id) { if (item2 != null) { item2.Level = item.Level; await collection.FindOneAndReplaceAsync(filter, player); } return(item2); } } return(null); }
public Task <Item> Modify(Guid playerid, Guid itemid, [FromBody] ModifiedItem item) { return(_processor.Modify(playerid, itemid, item)); }
public Task <Item> Modify(Guid playerid, Guid itemid, ModifiedItem item) { return(_repository.ModifyItem(playerid, itemid, item)); }