This commit is contained in:
@@ -5,6 +5,17 @@ using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.AspNetCore.JsonPatch;
|
||||
using EnumsNET;
|
||||
using AyaNova.Util;
|
||||
using AyaNova.Api.ControllerHelpers;
|
||||
using AyaNova.Models;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AyaNova.Util
|
||||
{
|
||||
@@ -325,7 +336,7 @@ namespace AyaNova.Util
|
||||
// Check if DB is empty
|
||||
// CALLED BY LICENSE CONTROLLER AND LICENSE.CS FOR TRIAL Request check
|
||||
// Also called by Import
|
||||
internal static bool DBIsEmpty(AyContext ct, ILogger _log)
|
||||
internal static async Task<bool> DBIsEmptyAsync(AyContext ct, ILogger _log)
|
||||
{
|
||||
//TODO: This needs to be way more thorough, only the main tables though, no need to get crazy with it
|
||||
//just stuff that would be shitty to have to re-enter
|
||||
@@ -333,7 +344,8 @@ namespace AyaNova.Util
|
||||
_log.LogDebug("DB empty check");
|
||||
|
||||
//An empty db contains only one User
|
||||
if (ct.User.Count() > 1) return false;
|
||||
if (await ct.User.LongCountAsync() > 1) return false;
|
||||
|
||||
|
||||
//No clients
|
||||
//if(ctx.Client.Count()>0) return false;
|
||||
|
||||
Reference in New Issue
Block a user