yep
This commit is contained in:
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user