hn-dotnet/Infrastructure/Repositories/CommentRepository.cs
2020-12-17 12:00:26 +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);
}
}
}