Code
·
24 lines
·
525 bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24using Microsoft.AspNetCore.Mvc;
using MongoDB.MvcCore;
namespace OpenKamer.LogicControllers.Web;
public partial class WebController : ControllerBase
{
[HttpGet]
[Route("~/api/HelloWorld")]
public async Task<IActionResult> HelloWorld()
{
// Forces a session cooky
HttpContext.Session.SetString("Hello", "World");
await HttpContext.Session.CommitAsync();
var Version = $"MongoDB.MvcCore.BsonJsonSerializer: {typeof(BsonJsonSerializer).Assembly.GetName().Version}";
return Ok(new
{
Version
});
}
}