28 lines
718 B
C#
28 lines
718 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using DataServer.Data;
|
|
|
|
namespace GameServices.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();
|
|
}
|
|
}
|