using Microsoft.AspNetCore.Mvc; using zero.Context; using zero.Identity; using zero.Stores; namespace zero.Demo.Controllers; public class TestController : ControllerBase { [HttpGet("")] public ActionResult Get(string id, string changeVector = null) { return new JsonResult(new { id = id }); } [HttpGet("/test/url")] public ActionResult GetUrl() { return new JsonResult(new { url = Url.Action("Get", new { id = "myid" }) }); } //[HttpGet] //public async Task Scoping([FromServices] IZeroContext ctx, [FromServices] IStoreOperations ops) //{ // string scopeA = null; // string scopeB = null; // string scopeC = null; // List usersA = new(); // List usersB = new(); // scopeA = ctx.Store.ResolvedDatabase; // using (var scope = ctx.CreateScope("laola")) // { // scopeB = ctx.Store.ResolvedDatabase; // usersA = await ops.LoadAll(); // } // scopeC = ctx.Store.ResolvedDatabase; // usersB = await ops.LoadAll(); // return Json(new // { // scopeA, // scopeB, // scopeC, // usersA, // usersB // }); //} }