Большой рефактор
This commit is contained in:
@@ -5,21 +5,17 @@ namespace Pf2eDataScrapper.Importers;
|
||||
|
||||
public class DatabaseHelper
|
||||
{
|
||||
public Pf2eDbContext Context = new();
|
||||
public readonly Pf2eDbContext Context = new();
|
||||
|
||||
public SlugHelper Slugger = new();
|
||||
public readonly SlugHelper Slugger = new();
|
||||
|
||||
private int _id = 0;
|
||||
private int _id;
|
||||
|
||||
public int NextEntityId
|
||||
{
|
||||
get => ++_id;
|
||||
set => _id = value;
|
||||
}
|
||||
public int NextEntityId => ++_id;
|
||||
|
||||
private DatabaseHelper()
|
||||
{
|
||||
NextEntityId = Context.Entities.Any() ? Context.Entities.Max(e => e.Id) : 0;
|
||||
_id = Context.Entities.Any() ? Context.Entities.Max(e => e.Id) : 0;
|
||||
}
|
||||
|
||||
public string GenerateSlug(string name)
|
||||
|
||||
Reference in New Issue
Block a user