Files
event-sourcing-jambo/source/Jambo.Infrastructure/Repositories/Posts/PostReadOnlyRepository.cs
Ivan Paulovich 2eddbb65e2 ok
2017-08-22 18:30:10 -03:00

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();
}
}
}