commited scoobydoo
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Nexus.Application.DTOs.Projects;
|
||||
using Nexus.Application.Interfaces;
|
||||
using Nexus.Infrastructure.Persistence;
|
||||
|
||||
namespace Nexus.Infrastructure.Services;
|
||||
|
||||
public class ProjectService : IProjectService
|
||||
{
|
||||
private readonly NexusDbContext _db;
|
||||
|
||||
public ProjectService(NexusDbContext db)
|
||||
{
|
||||
_db = db;
|
||||
}
|
||||
|
||||
public async Task<List<ProjectDto>> GetAllAsync()
|
||||
{
|
||||
return await _db.Projects
|
||||
.Select(p => new ProjectDto
|
||||
{
|
||||
Id = p.Id,
|
||||
Name = p.Name,
|
||||
CreatedAt = p.CreatedAt
|
||||
})
|
||||
.ToListAsync();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user