returning pb

This commit is contained in:
ntr committed 2023-08-29 13:52:19 +10:00
1 parent 51a3255b55
commit 1fb2d9eb1d
7 files changed
+141 -45

No files matched your search

+2 -23
View File
@@ -1,4 +1,6 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using System.Data.SqlClient;
using Server.Models;
namespace Server.Controllers;
@@ -25,29 +27,6 @@ public class LapController : ControllerBase {
});
}
// [HttpGet()]
// public LapStorageDTO UserLaps(Guid userId, string mapName) {
// List<Lap> laps = _db.Laps
// .Where(l => l.Id == userId)
// .Where(l => l.Map == mapName);
// int completions = _db.Laps
// .Where(l => l.Map == mapName)
// .Count();
// int position = _db.Database<Laps>.sql("""
// SELECT
// """);
// return new LapStorageDTO {
// Map = mapName,
// Laps = laps,
// public int Completions { get; set; }
// public int Position { get; set; }
// }
// }
[HttpPost()]
public async Task<Lap> Post(LapDTO dto) {
Lap existing = _db.Laps