30 lines
793 B
C#
30 lines
793 B
C#
using Jambo.Domain.Aggregates.Blogs;
|
|
using Jambo.Domain.Aggregates.Posts;
|
|
using MongoDB.Driver;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Jambo.Infrastructure.Repositories.Posts
|
|
{
|
|
public class PostReadOnlyRepository : IPostReadOnlyRepository
|
|
{
|
|
private readonly MongoContext _mongoContext;
|
|
|
|
public PostReadOnlyRepository(MongoContext mongoContext)
|
|
{
|
|
_mongoContext = mongoContext;
|
|
}
|
|
|
|
public async Task<IEnumerable<Post>> GetBlogPosts(Guid blogId)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public async Task<Post> GetPost(Guid id)
|
|
{
|
|
return await _mongoContext.Posts.Find(e => e.Id == id).SingleOrDefaultAsync();
|
|
}
|
|
}
|
|
}
|