29 lines
608 B
C#
29 lines
608 B
C#
using System;
|
|
using System.Threading.Tasks;
|
|
using HN.Domain;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace HN.Infrastructure
|
|
{
|
|
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);
|
|
}
|
|
|
|
public Task UpdateAsync(Comment comment)
|
|
{
|
|
return base.UpdateAsync(comment);
|
|
}
|
|
}
|
|
} |