hn-dotnet/Infrastructure/Repositories/CommentRepository.cs
Julien Leicher 7a9aefbefc tiny-refactors (#27)
add UnitWorkBehavior and some files moving
add Docker stuff to prepare heroku deployment
rename (Up/Down)vote
add sample for msbuild tasks
2020-12-17 12:01:11 +01:00

24 lines
523 B
C#

using System;
using System.Threading.Tasks;
using HN.Domain;
using Microsoft.EntityFrameworkCore;
namespace HN.Infrastructure.Repositories
{
public sealed class CommentRepository : Repository<Comment>, ICommentRepository
{
public CommentRepository(HNDbContext context) : base(context)
{
}
public Task AddAsync(Comment comment)
{
return base.AddAsync(comment);
}
public Task<Comment> GetByIdAsync(Guid id)
{
return Entries.SingleOrDefaultAsync(o => o.Id == id);
}
}
}