Move CV matcher repositories from cv-matcher-api to cv-matcher-data
- 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>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user