This commit is contained in:
2022-11-10 19:25:55 -06:00
parent f7f752b694
commit 02b83efc88
9 changed files with 64 additions and 12 deletions

View File

@@ -5,6 +5,6 @@ namespace Shogi.Api.Repositories.Dto;
/// <summary>
/// Useful with Dapper to read from database.
/// </summary>
public readonly record struct MoveDto(string From, string To, bool IsPromotion, WhichPiece? PieceFromHand)
public readonly record struct MoveDto(string? From, string To, bool? IsPromotion, WhichPiece? PieceFromHand)
{
}

View File

@@ -1,6 +1,7 @@
using Dapper;
using Shogi.Api.Extensions;
using Shogi.Api.Repositories.Dto;
using Shogi.Domain.Aggregates;
using Shogi.Domain;
using System.Data;
using System.Data.SqlClient;
@@ -65,6 +66,15 @@ public class SessionRepository : ISessionRepository
}
return session;
}
public async Task CreateMove(string sessionName, Contracts.Api.MovePieceCommand command)
{
using var connection = new SqlConnection(connectionString);
await connection.ExecuteAsync(
"session.CreateMove",
new { },
commandType: CommandType.StoredProcedure);
}
}
public interface ISessionRepository