mirror of
https://github.com/donnaskiez/ac.git
synced 2024-11-21 22:24:08 +01:00
37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
using Serilog;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using server.Database.Model;
|
|
using System.Reflection.Metadata.Ecma335;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace server.Database.Entity
|
|
{
|
|
public class HardwareConfigurationEntity : HardwareConfiguration
|
|
{
|
|
private readonly ModelContext _modelContext;
|
|
public UserEntity UserEntity { get; set; }
|
|
|
|
public HardwareConfigurationEntity(ModelContext modelContext)
|
|
{
|
|
UserEntity = new UserEntity(modelContext);
|
|
_modelContext = modelContext;
|
|
}
|
|
|
|
public bool CheckIfHardwareIsBanned()
|
|
{
|
|
return _modelContext.HardwareConfiguration.Any(
|
|
h => h.MotherboardSerial == MotherboardSerial &&
|
|
h.DeviceDrive0Serial == DeviceDrive0Serial &&
|
|
h.IsBanned);
|
|
}
|
|
|
|
public void InsertHardwareConfiguration()
|
|
{
|
|
_modelContext.HardwareConfiguration.Add(this);
|
|
}
|
|
}
|
|
}
|