♻️ No idea, but errors all gone
This commit is contained in:
29
DysonNetwork.Pass/Developer/CustomAppService.cs
Normal file
29
DysonNetwork.Pass/Developer/CustomAppService.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
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>, ICustomAppService
|
||||
{
|
||||
private readonly AppDatabase _db;
|
||||
|
||||
public CustomAppService(AppDatabase db)
|
||||
{
|
||||
_db = db;
|
||||
}
|
||||
|
||||
public async Task<CustomApp?> FindClientByIdAsync(Guid clientId)
|
||||
{
|
||||
return await _db.CustomApps.FirstOrDefaultAsync(app => app.Id == clientId);
|
||||
}
|
||||
|
||||
public async Task<int> CountCustomAppsByPublisherId(Guid publisherId)
|
||||
{
|
||||
return await _db.CustomApps.CountAsync(app => app.PublisherId == publisherId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user