Files
ServiceManager/ServiceManager.API/Services/ArticlesService.cs
Yaël Perret b4e977948b first commit
2026-04-02 19:19:12 +02:00

26 lines
586 B
C#

using Microsoft.EntityFrameworkCore;
using ServiceManager.API.Models;
namespace ServiceManager.API.Services
{
public interface IArticlesService
{
Task<IEnumerable<Article>> GetArticlesAsync();
}
public class ArticlesService : IArticlesService
{
private readonly AppDbContext _context;
public ArticlesService(AppDbContext context)
{
_context = context;
}
public async Task<IEnumerable<Article>> GetArticlesAsync()
{
return await _context.Articles.ToListAsync();
}
}
}