using MagicOnion.Server; using DysonNetwork.Shared.Services; using DysonNetwork.Shared.Models; using System; using System.Linq; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; namespace DysonNetwork.Pass.Developer; public class CustomAppService : ServiceBase, ICustomAppService { private readonly AppDatabase _db; public CustomAppService(AppDatabase db) { _db = db; } public async Task FindClientByIdAsync(Guid clientId) { return await _db.CustomApps.FirstOrDefaultAsync(app => app.Id == clientId); } public async Task CountCustomAppsByPublisherId(Guid publisherId) { return await _db.CustomApps.CountAsync(app => app.PublisherId == publisherId); } }