public async Task <ITable> CreateTable(TableTitle name, IAccount account) { var table = tableFactory.NewTable(name, account); await tableRepository.AddTableAsync(table); return(table); }
public async Task <TableDto> CreateTableAsync(TableDto tableDto) { Table table = tableDto.ToEntity(); Table created = await _repository.AddTableAsync(table); if (created == null) { throw new Exception("Table already exists."); } return(new TableDto(created)); }