mirror of https://github.com/abpframework/abp.git
csharpabpc-sharpframeworkblazoraspnet-coredotnet-coreaspnetcorearchitecturesaasdomain-driven-designangularmulti-tenancy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
794 B
26 lines
794 B
using System;
|
|
using System.Threading.Tasks;
|
|
using MongoDB.Driver.Linq;
|
|
using Volo.Abp.Domain.Repositories.MongoDB;
|
|
using Volo.Abp.MongoDB;
|
|
using Volo.Blogging.MongoDB;
|
|
|
|
namespace Volo.Blogging.Blogs
|
|
{
|
|
public class MongoBlogRepository : MongoDbRepository<IBloggingMongoDbContext, Blog, Guid>, IBlogRepository
|
|
{
|
|
public MongoBlogRepository(IMongoDbContextProvider<IBloggingMongoDbContext> dbContextProvider) : base(dbContextProvider)
|
|
{
|
|
}
|
|
|
|
public async Task<Blog> FindByShortNameAsync(string shortName)
|
|
{
|
|
return await GetMongoQueryable().FirstOrDefaultAsync(p => p.ShortName == shortName);
|
|
}
|
|
|
|
public async Task<int> GetTotalCount()
|
|
{
|
|
return await GetMongoQueryable().CountAsync();
|
|
}
|
|
}
|
|
}
|
|
|