first commit
This commit is contained in:
25
ServiceManager.API/Services/ArticlesService.cs
Normal file
25
ServiceManager.API/Services/ArticlesService.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user