private static RepositoryEntityTable EntitiesFromClientDto(ClientRollDTO roll) => new RepositoryEntityTable { Rows = roll.AssociatedEntities.Select(a => new RepositoryEntity { PublicId = a }) };
private static RepositoryDieRollTable MultiDiceFromClientDto(ClientRollDTO roll) => new RepositoryDieRollTable { Rows = roll.RollValues.Select(typeGroup => typeGroup.Values.Select(v => new RepositoryDieRoll { NumberOfSides = typeGroup.DieType, Value = v })) .SelectMany(s => s) };
public async Task <ActionResult> Post([FromBody] ClientRollDTO roll) { await _repository.InsertRollAsync(roll); return(Ok()); }
public async Task InsertRollAsync(ClientRollDTO roll) => await _utility.InsertRollAsync <MiscellaneousRollRepositoyDto>("[Rolls].[Sto_InsertMiscellaneousRoll]", roll);
public async Task InsertRollAsync <T>(string procedureName, ClientRollDTO roll) where T : BaseRollRepositoryDto { using var connection = _connectionFactory.GetWriteConnection(); await connection.QueryAsync(procedureName, _mapper.Map <T>(roll), commandType : CommandType.StoredProcedure); }
public async Task InsertRollAsync(ClientRollDTO roll) => await _utility.InsertRollAsync <AttackRollRepositoryDto>("[Rolls].[Sto_InsertAttackRoll]", roll);
public async Task InsertRollAsync(ClientRollDTO roll) => await _utility.InsertRollAsync <InitiativeRollRepositoryDto>("[Rolls].[Sto_InsertInitiativeRoll]", roll);
private static RepositoryRollCommentTable RollCommentsFromClientDto(ClientRollDTO roll) => new RepositoryRollCommentTable();
private static RepositoryRollModifier ModifierFromClientDto(ClientRollDTO roll) => new RepositoryRollModifier { Value = roll.Modifier };
private static RepositoryDieRoll SingleDieRollFromClientDto(ClientRollDTO roll, int sides) => new RepositoryDieRoll { NumberOfSides = sides, Value = roll.RollValue };
public async Task InsertRollAsync(ClientRollDTO roll) => await _utility.InsertRollAsync <SavingThrowRepositoryDto>("[Rolls].[Sto_InsertSavingThrow]", roll);