23 lines
654 B
C#
23 lines
654 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using PortBlog.API.DbContexts;
|
|
using PortBlog.API.Entities;
|
|
using PortBlog.API.Repositories.Contracts;
|
|
|
|
namespace PortBlog.API.Repositories
|
|
{
|
|
public class HobbyRepository : IHobbyRepository
|
|
{
|
|
private readonly CvBlogContext _cvBlogContext;
|
|
|
|
public HobbyRepository(CvBlogContext cvBlogContext)
|
|
{
|
|
_cvBlogContext = cvBlogContext;
|
|
}
|
|
|
|
public async Task<IEnumerable<Hobby>> GetHobbiesForResumeAsync(int resumeId)
|
|
{
|
|
return await _cvBlogContext.Hobbies.Where(h => h.ResumeId == resumeId).OrderBy(h => h.Order).ToListAsync();
|
|
}
|
|
}
|
|
}
|