Backend Services Split into separate projects for reference from other front ends
This commit is contained in:
@@ -44,7 +44,8 @@
|
||||
"Read(/F:\\Development\\DeepDrftHome\\DeepDrftModels\\DTOs/**)",
|
||||
"Read(/F:\\Development\\DeepDrftHome\\DeepDrftTests/**)",
|
||||
"Read(/F:\\Development\\DeepDrftHome\\DeepDrftTests/**)",
|
||||
"Read(/F:\\Development\\DeepDrftHome\\DeepDrftTests/**)"
|
||||
"Read(/F:\\Development\\DeepDrftHome\\DeepDrftTests/**)",
|
||||
"Read(//f/Development/NetBlocks/**)"
|
||||
],
|
||||
"deny": [],
|
||||
"ask": []
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace DeepDrftContent.Constants;
|
||||
namespace DeepDrftContent.Services.Constants;
|
||||
|
||||
/// <summary>
|
||||
/// Constants for FileDatabase vault names
|
||||
@@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DeepDrftModels\DeepDrftModels.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
using DeepDrftContent.FileDatabase.Models;
|
||||
using IndexType = DeepDrftContent.FileDatabase.Services.IndexType;
|
||||
using DeepDrftContent.Services.FileDatabase.Models;
|
||||
using IndexType = DeepDrftContent.Services.FileDatabase.Services.IndexType;
|
||||
|
||||
namespace DeepDrftContent.FileDatabase.Abstractions;
|
||||
namespace DeepDrftContent.Services.FileDatabase.Abstractions;
|
||||
|
||||
/// <summary>
|
||||
/// Interface for creating index instances
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
using DeepDrftContent.FileDatabase.Models;
|
||||
using DeepDrftContent.FileDatabase.Services;
|
||||
using DeepDrftContent.Services.FileDatabase.Models;
|
||||
using DeepDrftContent.Services.FileDatabase.Services;
|
||||
|
||||
namespace DeepDrftContent.FileDatabase.Abstractions;
|
||||
namespace DeepDrftContent.Services.FileDatabase.Abstractions;
|
||||
|
||||
/// <summary>
|
||||
/// Interface for registering media type factories
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace DeepDrftContent.FileDatabase.Models;
|
||||
namespace DeepDrftContent.Services.FileDatabase.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Base interface for all index types - minimal contract
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
using DeepDrftContent.FileDatabase.Utils;
|
||||
using DeepDrftContent.Services.FileDatabase.Utils;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace DeepDrftContent.FileDatabase.Models;
|
||||
namespace DeepDrftContent.Services.FileDatabase.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Base class for index data used in serialization
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
using DeepDrftContent.FileDatabase.Abstractions;
|
||||
using DeepDrftContent.FileDatabase.Services;
|
||||
using DeepDrftContent.Services.FileDatabase.Abstractions;
|
||||
using DeepDrftContent.Services.FileDatabase.Services;
|
||||
|
||||
namespace DeepDrftContent.FileDatabase.Models;
|
||||
namespace DeepDrftContent.Services.FileDatabase.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Type mappings for media vault types - simple dictionary-based approach
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace DeepDrftContent.FileDatabase.Models;
|
||||
namespace DeepDrftContent.Services.FileDatabase.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Parameters for creating a FileBinary
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace DeepDrftContent.FileDatabase.Models;
|
||||
namespace DeepDrftContent.Services.FileDatabase.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Enum representing different types of media vaults
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace DeepDrftContent.FileDatabase.Models;
|
||||
namespace DeepDrftContent.Services.FileDatabase.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Base metadata for media entries
|
||||
+4
-4
@@ -1,8 +1,8 @@
|
||||
using DeepDrftContent.FileDatabase.Models;
|
||||
using DeepDrftContent.FileDatabase.Utils;
|
||||
using IndexType = DeepDrftContent.FileDatabase.Services.IndexType;
|
||||
using DeepDrftContent.Services.FileDatabase.Models;
|
||||
using DeepDrftContent.Services.FileDatabase.Utils;
|
||||
using IndexType = DeepDrftContent.Services.FileDatabase.Services.IndexType;
|
||||
|
||||
namespace DeepDrftContent.FileDatabase.Services;
|
||||
namespace DeepDrftContent.Services.FileDatabase.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Main file database class that orchestrates multiple media vaults
|
||||
+5
-5
@@ -1,9 +1,9 @@
|
||||
using DeepDrftContent.FileDatabase.Abstractions;
|
||||
using DeepDrftContent.FileDatabase.Models;
|
||||
using DeepDrftContent.FileDatabase.Utils;
|
||||
using IndexType = DeepDrftContent.FileDatabase.Services.IndexType;
|
||||
using DeepDrftContent.Services.FileDatabase.Abstractions;
|
||||
using DeepDrftContent.Services.FileDatabase.Models;
|
||||
using DeepDrftContent.Services.FileDatabase.Utils;
|
||||
using IndexType = DeepDrftContent.Services.FileDatabase.Services.IndexType;
|
||||
|
||||
namespace DeepDrftContent.FileDatabase.Services;
|
||||
namespace DeepDrftContent.Services.FileDatabase.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Factory service for creating and managing indexes
|
||||
+4
-4
@@ -1,8 +1,8 @@
|
||||
using DeepDrftContent.FileDatabase.Abstractions;
|
||||
using DeepDrftContent.FileDatabase.Models;
|
||||
using DeepDrftContent.FileDatabase.Utils;
|
||||
using DeepDrftContent.Services.FileDatabase.Abstractions;
|
||||
using DeepDrftContent.Services.FileDatabase.Models;
|
||||
using DeepDrftContent.Services.FileDatabase.Utils;
|
||||
|
||||
namespace DeepDrftContent.FileDatabase.Services;
|
||||
namespace DeepDrftContent.Services.FileDatabase.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Enum representing different types of indexes
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using DeepDrftContent.FileDatabase.Models;
|
||||
using DeepDrftContent.FileDatabase.Utils;
|
||||
using DeepDrftContent.Services.FileDatabase.Models;
|
||||
using DeepDrftContent.Services.FileDatabase.Utils;
|
||||
|
||||
namespace DeepDrftContent.FileDatabase.Services;
|
||||
namespace DeepDrftContent.Services.FileDatabase.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Abstract base class for media vaults that store and manage media files
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
using DeepDrftContent.FileDatabase.Abstractions;
|
||||
using DeepDrftContent.FileDatabase.Models;
|
||||
using DeepDrftContent.Services.FileDatabase.Abstractions;
|
||||
using DeepDrftContent.Services.FileDatabase.Models;
|
||||
|
||||
namespace DeepDrftContent.FileDatabase.Services;
|
||||
namespace DeepDrftContent.Services.FileDatabase.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Factory for creating media vaults
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
using DeepDrftContent.FileDatabase.Abstractions;
|
||||
using DeepDrftContent.FileDatabase.Models;
|
||||
using DeepDrftContent.Services.FileDatabase.Abstractions;
|
||||
using DeepDrftContent.Services.FileDatabase.Models;
|
||||
|
||||
namespace DeepDrftContent.FileDatabase.Services;
|
||||
namespace DeepDrftContent.Services.FileDatabase.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Simple dictionary-based registry for media type factories
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
using System.Text.Json;
|
||||
using DeepDrftContent.FileDatabase.Models;
|
||||
using DeepDrftContent.Services.FileDatabase.Models;
|
||||
|
||||
namespace DeepDrftContent.FileDatabase.Utils;
|
||||
namespace DeepDrftContent.Services.FileDatabase.Utils;
|
||||
|
||||
/// <summary>
|
||||
/// Utility class for file I/O operations, matching the TypeScript file utilities
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
using System.Collections;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace DeepDrftContent.FileDatabase.Utils;
|
||||
namespace DeepDrftContent.Services.FileDatabase.Utils;
|
||||
|
||||
/// <summary>
|
||||
/// A map implementation that uses structural equality for keys by serializing them to JSON.
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
using System.Collections;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace DeepDrftContent.FileDatabase.Utils;
|
||||
namespace DeepDrftContent.Services.FileDatabase.Utils;
|
||||
|
||||
/// <summary>
|
||||
/// A set implementation that uses structural equality for values by serializing them to JSON.
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
using DeepDrftContent.FileDatabase.Models;
|
||||
using DeepDrftContent.Services.FileDatabase.Models;
|
||||
|
||||
namespace DeepDrftContent.Processors;
|
||||
namespace DeepDrftContent.Services.Processors;
|
||||
|
||||
/// <summary>
|
||||
/// Service for processing audio files and extracting metadata
|
||||
@@ -1,6 +1,6 @@
|
||||
using DeepDrftContent.Constants;
|
||||
using DeepDrftContent.FileDatabase.Services;
|
||||
using DeepDrftContent.Processors;
|
||||
using DeepDrftContent.Services.Constants;
|
||||
using DeepDrftContent.Services.FileDatabase.Services;
|
||||
using DeepDrftContent.Services.Processors;
|
||||
using DeepDrftModels.Entities;
|
||||
|
||||
namespace DeepDrftContent.Services;
|
||||
@@ -52,7 +52,7 @@ public class TrackService
|
||||
// Ensure tracks vault exists
|
||||
if (!_fileDatabase.HasVault(VaultConstants.Tracks))
|
||||
{
|
||||
await _fileDatabase.CreateVaultAsync(VaultConstants.Tracks, DeepDrftContent.FileDatabase.Models.MediaVaultType.Audio);
|
||||
await _fileDatabase.CreateVaultAsync(VaultConstants.Tracks, DeepDrftContent.Services.FileDatabase.Models.MediaVaultType.Audio);
|
||||
}
|
||||
|
||||
// Store the audio in FileDatabase
|
||||
@@ -86,9 +86,9 @@ public class TrackService
|
||||
/// </summary>
|
||||
/// <param name="trackId">Track ID (EntryKey)</param>
|
||||
/// <returns>Audio binary or null if not found</returns>
|
||||
public async Task<DeepDrftContent.FileDatabase.Models.AudioBinary?> GetAudioBinaryAsync(string trackId)
|
||||
public async Task<DeepDrftContent.Services.FileDatabase.Models.AudioBinary?> GetAudioBinaryAsync(string trackId)
|
||||
{
|
||||
return await _fileDatabase.LoadResourceAsync<DeepDrftContent.FileDatabase.Models.AudioBinary>(VaultConstants.Tracks, trackId);
|
||||
return await _fileDatabase.LoadResourceAsync<DeepDrftContent.Services.FileDatabase.Models.AudioBinary>(VaultConstants.Tracks, trackId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -106,7 +106,7 @@ public class TrackService
|
||||
{
|
||||
if (!_fileDatabase.HasVault(VaultConstants.Tracks))
|
||||
{
|
||||
await _fileDatabase.CreateVaultAsync(VaultConstants.Tracks, DeepDrftContent.FileDatabase.Models.MediaVaultType.Audio);
|
||||
await _fileDatabase.CreateVaultAsync(VaultConstants.Tracks, DeepDrftContent.Services.FileDatabase.Models.MediaVaultType.Audio);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
using DeepDrftContent.Constants;
|
||||
using DeepDrftContent.FileDatabase.Models;
|
||||
using DeepDrftContent.Services.Constants;
|
||||
using DeepDrftContent.Services.FileDatabase.Models;
|
||||
using DeepDrftContent.Middleware;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
@@ -9,9 +9,9 @@ namespace DeepDrftContent.Controllers;
|
||||
[Route("api/[controller]")]
|
||||
public class TrackController : ControllerBase
|
||||
{
|
||||
private readonly FileDatabase.Services.FileDatabase _fileDatabase;
|
||||
private readonly DeepDrftContent.Services.FileDatabase.Services.FileDatabase _fileDatabase;
|
||||
|
||||
public TrackController(FileDatabase.Services.FileDatabase fileDatabase)
|
||||
public TrackController(DeepDrftContent.Services.FileDatabase.Services.FileDatabase fileDatabase)
|
||||
{
|
||||
_fileDatabase = fileDatabase;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DeepDrftModels\DeepDrftModels.csproj" />
|
||||
<ProjectReference Include="..\DeepDrftContent.Services\DeepDrftContent.Services.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using DeepDrftContent;
|
||||
using DeepDrftContent.FileDatabase.Services;
|
||||
using DeepDrftContent.Services.FileDatabase.Services;
|
||||
using DeepDrftContent.Middleware;
|
||||
using DeepDrftContent.Models;
|
||||
using Microsoft.AspNetCore.HttpOverrides;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using DeepDrftContent.Constants;
|
||||
using DeepDrftContent.FileDatabase.Models;
|
||||
using DeepDrftContent.FileDatabase.Services;
|
||||
using DeepDrftContent.Services.Constants;
|
||||
using DeepDrftContent.Services.FileDatabase.Models;
|
||||
using DeepDrftContent.Services.FileDatabase.Services;
|
||||
using DeepDrftContent.Models;
|
||||
|
||||
namespace DeepDrftContent
|
||||
@@ -14,13 +14,13 @@ namespace DeepDrftContent
|
||||
var fileDatabaseSettings = builder.Configuration.GetSection(nameof(FileDatabaseSettings)).Get<FileDatabaseSettings>();
|
||||
if (fileDatabaseSettings is null) { throw new Exception("File database settings are not configured"); }
|
||||
|
||||
var fileDatabase = await FileDatabase.Services.FileDatabase.FromAsync(fileDatabaseSettings.VaultPath);
|
||||
var fileDatabase = await FileDatabase.FromAsync(fileDatabaseSettings.VaultPath);
|
||||
if (fileDatabase is null) { throw new Exception("Unable to initialize file database"); }
|
||||
builder.Services.AddSingleton(fileDatabase);
|
||||
await InitializeTrackVault(fileDatabase);
|
||||
}
|
||||
|
||||
private static async Task InitializeTrackVault(FileDatabase.Services.FileDatabase fileDatabase)
|
||||
private static async Task InitializeTrackVault(FileDatabase fileDatabase)
|
||||
{
|
||||
if (!fileDatabase.HasVault(VaultConstants.Tracks))
|
||||
{
|
||||
|
||||
@@ -14,6 +14,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeepDrftTests", "DeepDrftTe
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeepDrftCli", "DeepDrftCli\DeepDrftCli.csproj", "{E4C0ADD6-1264-47A5-98E1-0843AD14B7F9}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeepDrftWeb.Services", "DeepDrftWeb.Services\DeepDrftWeb.Services.csproj", "{1D1CE905-DAD0-4E93-9B09-326E8EC05877}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeepDrftContent.Services", "DeepDrftContent.Services\DeepDrftContent.Services.csproj", "{4D025326-7F27-4C42-BE0F-92C1E64E0696}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -108,6 +112,30 @@ Global
|
||||
{E4C0ADD6-1264-47A5-98E1-0843AD14B7F9}.Release|x64.Build.0 = Release|Any CPU
|
||||
{E4C0ADD6-1264-47A5-98E1-0843AD14B7F9}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{E4C0ADD6-1264-47A5-98E1-0843AD14B7F9}.Release|x86.Build.0 = Release|Any CPU
|
||||
{1D1CE905-DAD0-4E93-9B09-326E8EC05877}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1D1CE905-DAD0-4E93-9B09-326E8EC05877}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1D1CE905-DAD0-4E93-9B09-326E8EC05877}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{1D1CE905-DAD0-4E93-9B09-326E8EC05877}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{1D1CE905-DAD0-4E93-9B09-326E8EC05877}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{1D1CE905-DAD0-4E93-9B09-326E8EC05877}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{1D1CE905-DAD0-4E93-9B09-326E8EC05877}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1D1CE905-DAD0-4E93-9B09-326E8EC05877}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{1D1CE905-DAD0-4E93-9B09-326E8EC05877}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{1D1CE905-DAD0-4E93-9B09-326E8EC05877}.Release|x64.Build.0 = Release|Any CPU
|
||||
{1D1CE905-DAD0-4E93-9B09-326E8EC05877}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{1D1CE905-DAD0-4E93-9B09-326E8EC05877}.Release|x86.Build.0 = Release|Any CPU
|
||||
{4D025326-7F27-4C42-BE0F-92C1E64E0696}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4D025326-7F27-4C42-BE0F-92C1E64E0696}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4D025326-7F27-4C42-BE0F-92C1E64E0696}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{4D025326-7F27-4C42-BE0F-92C1E64E0696}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{4D025326-7F27-4C42-BE0F-92C1E64E0696}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{4D025326-7F27-4C42-BE0F-92C1E64E0696}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{4D025326-7F27-4C42-BE0F-92C1E64E0696}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4D025326-7F27-4C42-BE0F-92C1E64E0696}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{4D025326-7F27-4C42-BE0F-92C1E64E0696}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{4D025326-7F27-4C42-BE0F-92C1E64E0696}.Release|x64.Build.0 = Release|Any CPU
|
||||
{4D025326-7F27-4C42-BE0F-92C1E64E0696}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{4D025326-7F27-4C42-BE0F-92C1E64E0696}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DeepDrftContent\DeepDrftContent.csproj" />
|
||||
<ProjectReference Include="..\DeepDrftContent.Services\DeepDrftContent.Services.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using DeepDrftContent.FileDatabase.Models;
|
||||
using DeepDrftContent.FileDatabase.Services;
|
||||
using DeepDrftContent.Services.FileDatabase.Models;
|
||||
using DeepDrftContent.Services.FileDatabase.Services;
|
||||
|
||||
namespace DeepDrftTests;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using DeepDrftContent.FileDatabase.Abstractions;
|
||||
using DeepDrftContent.FileDatabase.Models;
|
||||
using DeepDrftContent.FileDatabase.Services;
|
||||
using DeepDrftContent.FileDatabase.Utils;
|
||||
using DeepDrftContent.Services.FileDatabase.Abstractions;
|
||||
using DeepDrftContent.Services.FileDatabase.Models;
|
||||
using DeepDrftContent.Services.FileDatabase.Services;
|
||||
using DeepDrftContent.Services.FileDatabase.Utils;
|
||||
|
||||
namespace DeepDrftTests;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using DeepDrftContent.FileDatabase.Models;
|
||||
using DeepDrftContent.FileDatabase.Services;
|
||||
using DeepDrftContent.Services.FileDatabase.Models;
|
||||
using DeepDrftContent.Services.FileDatabase.Services;
|
||||
|
||||
namespace DeepDrftTests;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using DeepDrftContent.FileDatabase.Models;
|
||||
using DeepDrftContent.FileDatabase.Services;
|
||||
using DeepDrftContent.FileDatabase.Utils;
|
||||
using DeepDrftContent.Services.FileDatabase.Models;
|
||||
using DeepDrftContent.Services.FileDatabase.Services;
|
||||
using DeepDrftContent.Services.FileDatabase.Utils;
|
||||
|
||||
namespace DeepDrftTests;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using DeepDrftContent.FileDatabase.Models;
|
||||
using DeepDrftContent.Services.FileDatabase.Models;
|
||||
|
||||
namespace DeepDrftTests;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using DeepDrftContent.FileDatabase.Models;
|
||||
using DeepDrftContent.FileDatabase.Services;
|
||||
using DeepDrftContent.Services.FileDatabase.Models;
|
||||
using DeepDrftContent.Services.FileDatabase.Services;
|
||||
|
||||
namespace DeepDrftTests;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using DeepDrftContent.FileDatabase.Models;
|
||||
using DeepDrftContent.Services.FileDatabase.Models;
|
||||
|
||||
namespace DeepDrftTests;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using DeepDrftContent.FileDatabase.Models;
|
||||
using DeepDrftContent.FileDatabase.Utils;
|
||||
using DeepDrftContent.Services.FileDatabase.Models;
|
||||
using DeepDrftContent.Services.FileDatabase.Utils;
|
||||
|
||||
namespace DeepDrftTests;
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace DeepDrftWeb.Data.Configurations;
|
||||
namespace DeepDrftWeb.Services.Data.Configurations;
|
||||
|
||||
public class TrackConfiguration : IEntityTypeConfiguration<TrackEntity>
|
||||
{
|
||||
@@ -1,8 +1,8 @@
|
||||
using DeepDrftModels.Entities;
|
||||
using DeepDrftWeb.Data.Configurations;
|
||||
using DeepDrftWeb.Services.Data.Configurations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace DeepDrftWeb.Data;
|
||||
namespace DeepDrftWeb.Services.Data;
|
||||
|
||||
public class DeepDrftContext : DbContext
|
||||
{
|
||||
@@ -0,0 +1,18 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.8" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.8" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DeepDrftModels\DeepDrftModels.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
+2
-1
@@ -1,8 +1,9 @@
|
||||
using DeepDrftModels.Entities;
|
||||
using DeepDrftModels.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using DeepDrftWeb.Services.Data;
|
||||
|
||||
namespace DeepDrftWeb.Data.Repositories;
|
||||
namespace DeepDrftWeb.Services.Repositories;
|
||||
|
||||
public class TrackRepository
|
||||
{
|
||||
@@ -1,7 +1,7 @@
|
||||
using DeepDrftModels.Entities;
|
||||
using DeepDrftModels.Models;
|
||||
using DeepDrftWeb.Data;
|
||||
using DeepDrftWeb.Data.Repositories;
|
||||
using DeepDrftWeb.Services.Data;
|
||||
using DeepDrftWeb.Services.Repositories;
|
||||
using NetBlocks.Models;
|
||||
|
||||
namespace DeepDrftWeb.Services;
|
||||
@@ -1,24 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Design;
|
||||
|
||||
namespace DeepDrftWeb.Data;
|
||||
|
||||
public static class DeepDrftContextFactory
|
||||
{
|
||||
public class Factory : IDesignTimeDbContextFactory<DeepDrftContext>
|
||||
{
|
||||
public DeepDrftContext CreateDbContext(string[] args)
|
||||
{
|
||||
var configuration = new ConfigurationBuilder()
|
||||
.SetBasePath(Directory.GetCurrentDirectory())
|
||||
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
|
||||
.AddJsonFile("appsettings.Development.json", optional: true, reloadOnChange: true)
|
||||
.Build();
|
||||
|
||||
var optionsBuilder = new DbContextOptionsBuilder<DeepDrftContext>();
|
||||
optionsBuilder.UseSqlite(configuration.GetConnectionString("DefaultConnection"));
|
||||
|
||||
return new DeepDrftContext(optionsBuilder.Options);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,7 @@
|
||||
</PackageReference>
|
||||
<ProjectReference Include="..\DeepDrftModels\DeepDrftModels.csproj" />
|
||||
<ProjectReference Include="..\DeepDrftWeb.Client\DeepDrftWeb.Client.csproj" />
|
||||
<ProjectReference Include="..\DeepDrftWeb.Services\DeepDrftWeb.Services.csproj" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="9.*" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using DeepDrftWeb.Data;
|
||||
using DeepDrftWeb.Services.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using DeepDrftWeb.Data;
|
||||
using DeepDrftWeb.Services.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using DeepDrftWeb.Data;
|
||||
using DeepDrftWeb.Data.Repositories;
|
||||
using DeepDrftWeb.Services.Data;
|
||||
using DeepDrftWeb.Services.Repositories;
|
||||
using DeepDrftWeb.Services;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user