Files
systemrevivalserver/Services/Admin/Pages/Index.cshtml.cs
T

28 lines
721 B
C#

using Microsoft.EntityFrameworkCore;
using DataServer.Data;
namespace Server.Services.Admin.Pages;
public class IndexModel : AdminPageModel
{
private readonly GameDbContext _db;
public IndexModel(GameDbContext db)
{
_db = db;
}
public int ItemCount { get; set; }
public int MobCount { get; set; }
public int RecipeCount { get; set; }
public int PlayerCount { get; set; }
public async Task OnGetAsync()
{
ItemCount = await _db.DungeonItemDefinitions.CountAsync();
MobCount = await _db.DungeonMobDefinitions.CountAsync();
RecipeCount = await _db.DungeonCraftingRecipes.CountAsync();
PlayerCount = await _db.Accounts.CountAsync();
}
}