Add project files.

This commit is contained in:
2025-08-26 09:20:13 -04:00
parent 6c6a149821
commit d2201d6f9b
118 changed files with 1924 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
using Microsoft.EntityFrameworkCore;
namespace JSMR.Infrastructure.Data.Repositories.Circles;
internal static class CircleLookup
{
public static async Task<int?> ResolveCircleIdAsync(AppDbContext context, int? circleId, string? nameOrMakerId, CancellationToken cancellationToken)
{
if (circleId.HasValue)
return circleId.Value;
if (!string.IsNullOrWhiteSpace(nameOrMakerId))
{
return await context.Circles
.Where(c => c.Name == nameOrMakerId || c.MakerId == nameOrMakerId)
.Select(c => (int?)c.CircleId)
.FirstOrDefaultAsync(cancellationToken);
}
return null;
}
}