Skip to content

Commit 99819e4

Browse files
committed
Return existing implementations to simple version
now we're using SQL for Integration testing... Also restructured the solution folder structure
1 parent ad9aba7 commit 99819e4

File tree

4 files changed

+18
-123
lines changed

4 files changed

+18
-123
lines changed

AStar.Dev.Infrastructure.FilesDb/Data/FileDetailDirectoryNameExtensions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using AStar.Dev.Infrastructure.FilesDb.Models;
22
using AStar.Dev.Utilities;
3-
using Microsoft.EntityFrameworkCore;
43

54
namespace AStar.Dev.Infrastructure.FilesDb.Data;
65

@@ -18,6 +17,6 @@ public static class FileDetailDirectoryNameExtensions
1817
/// <returns></returns>
1918
public static IQueryable<FileDetail> WhereDirectoryNameMatches(this IQueryable<FileDetail> filesContext, string directoryName, bool includeSubDirectories) =>
2019
includeSubDirectories
21-
? filesContext.Where(file => EF.Functions.Like(file.DirectoryName.Value, $"{directoryName.RemoveTrailing(@"\")}%"))
20+
? filesContext.Where(file => file.DirectoryName.Value.StartsWith(directoryName.RemoveTrailing(@"\")))
2221
: filesContext.Where(file => file.DirectoryName.Value == directoryName.RemoveTrailing(@"\"));
2322
}

AStar.Dev.Infrastructure.FilesDb/Data/FileDetailLastViewedExtensions.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@ public static class FileDetailLastViewedExtensions
1616
/// <param name="time"></param>
1717
/// <returns></returns>
1818
public static IQueryable<FileDetail> WhereLastViewedIsOlderThan(this IQueryable<FileDetail> filesContext, int days, TimeProvider time)
19-
{
20-
if (days == 0)
21-
{
22-
return filesContext;
23-
}
24-
25-
var cutoff = time.GetUtcNow().AddDays(-days);
26-
return filesContext.Where(file => !file.FileLastViewed.HasValue || file.FileLastViewed.Value <= cutoff);
27-
}
19+
=> days == 0
20+
? filesContext
21+
: filesContext.Where(file => !file.FileLastViewed.HasValue || file.FileLastViewed.Value <= time.GetUtcNow().AddDays(-days));
2822
}

AStar.Dev.Infrastructure.FilesDb/Data/FilesContextExtensionsOld.cs

Lines changed: 0 additions & 112 deletions
This file was deleted.

DatabaseTesting.sln

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
3434
.github\workflows\main_astar-dev.yml = .github\workflows\main_astar-dev.yml
3535
EndProjectSection
3636
EndProject
37+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{D61F13DC-3A32-42BE-8687-F795D7332A51}"
38+
EndProject
39+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{D96E7D57-B3CF-4792-8532-59F03453A8B6}"
40+
EndProject
41+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "support", "support", "{F06BC983-3361-41B2-B64F-7A77A2E32782}"
42+
EndProject
3743
Global
3844
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3945
Debug|Any CPU = Debug|Any CPU
@@ -82,5 +88,13 @@ Global
8288
GlobalSection(NestedProjects) = preSolution
8389
{EB916946-4AEB-4F7A-B6AF-E270D6574EC0} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
8490
{1B8EF033-F575-495D-BC9C-D0539E66EC28} = {EB916946-4AEB-4F7A-B6AF-E270D6574EC0}
91+
{69DE5BF3-2489-45F8-B0E6-1F22C50A6F8F} = {D61F13DC-3A32-42BE-8687-F795D7332A51}
92+
{4583EF12-7DF4-4BDF-BC04-9AD46A92A8D7} = {D61F13DC-3A32-42BE-8687-F795D7332A51}
93+
{2860766A-6251-4874-9535-199ED5E29AA0} = {D96E7D57-B3CF-4792-8532-59F03453A8B6}
94+
{08DE9921-9593-4530-B062-84A41A6FAA90} = {F06BC983-3361-41B2-B64F-7A77A2E32782}
95+
{28720605-9CA9-4A33-BB00-655F4B76CA19} = {F06BC983-3361-41B2-B64F-7A77A2E32782}
96+
{8DAFC3FE-4221-4D86-8880-2DD29CA7BA68} = {F06BC983-3361-41B2-B64F-7A77A2E32782}
97+
{DBD16199-CAE1-44E0-9399-ED8EB0B6B806} = {F06BC983-3361-41B2-B64F-7A77A2E32782}
98+
{FE38F9CD-8573-44D1-A03F-73D318B6E86D} = {F06BC983-3361-41B2-B64F-7A77A2E32782}
8599
EndGlobalSection
86100
EndGlobal

0 commit comments

Comments
 (0)