public Task <Item> CreateItem(Guid playerId, NewItem item) { Item forward = new Item(); forward.ItemName = item.ItemName; forward.CreationTime = DateTime.Now; forward.Type = item.Type; forward.Level = 0; forward.Id = Guid.NewGuid(); return(repository.CreateItem(playerId, forward)); }
public async Task <Item> CreateItem(Guid playerId, NewItem item) { Item forward = new Item(); forward.ItemName = item.ItemName; Player owner = await repository.GetPlayer(playerId); forward.OwnerName = owner.Name; forward.CreationTime = DateTime.Now; forward.Type = (itemTypes)Enum.Parse(typeof(itemTypes), item.Type); forward.Level = 0; forward.Id = Guid.NewGuid(); return(await repository.CreateItem(playerId, forward)); }
public Task <Item> CreateItem(Guid playerId, [FromBody] NewItem item) { return(processor.CreateItem(playerId, item)); }