43017036fd
- Move IAiPromptsRepository, EfAiPromptsRepository to cv-matcher-data/Repositories - Move IMatcherRepository, EfMatcherRepository to cv-matcher-data/Repositories - Add cv-matcher-api-models ProjectReference to cv-matcher-data.csproj - Delete cv-matcher-api/Data folder (all data access now in cv-matcher-data) Pattern: cv-matcher-api (logic) → cv-matcher-data (repositories, EF entities, migrations) Aligns with rag-api → rag-data consolidation Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
25 lines
649 B
C#
25 lines
649 B
C#
using CvMatcher.Data;
|
|
using CvMatcher.Data.Repositories.Contracts;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace CvMatcher.Data.Repositories;
|
|
|
|
public sealed class EfAiPromptsRepository : IAiPromptsRepository
|
|
{
|
|
private readonly CvMatcherDbContext _db;
|
|
|
|
public EfAiPromptsRepository(CvMatcherDbContext db)
|
|
{
|
|
_db = db;
|
|
}
|
|
|
|
public async Task<string?> GetAsync(string key, string language, CancellationToken ct)
|
|
{
|
|
return await _db.AiPrompts
|
|
.AsNoTracking()
|
|
.Where(x => x.Key == key && x.Language == language)
|
|
.Select(x => x.Value)
|
|
.FirstOrDefaultAsync(ct);
|
|
}
|
|
}
|