using Microsoft.AspNetCore.Mvc; using zero.Context; using zero.Identity; using zero.Stores; namespace zero.Demo.Controllers; public class TestController : Controller { [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 }); } }