Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Genocs.Core.UnitTests/Genocs.Core.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="9.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Genocs.Core.Domain.Entities;
using Genocs.Core.Domain.Repositories;
using MongoDB.Driver;
using MongoDB.Driver.Linq;

namespace Genocs.Persistence.MongoDb.Domain.Repositories;

Expand All @@ -12,7 +11,7 @@ public interface IMongoDbBaseRepository<TEntity, TKey> : IRepositoryOfEntity<TEn
{
IMongoCollection<TEntity> Collection { get; }

IMongoQueryable<TEntity> GetMongoQueryable();
IQueryable<TEntity> GetMongoQueryable();

Task<TEntity> GetAsync(Expression<Func<TEntity, bool>> predicate);
Task<IReadOnlyList<TEntity>> FindAsync(Expression<Func<TEntity, bool>> predicate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public MongoDbBaseRepository(IMongoDatabase database, string collectionName)
/// It returns the Mongo Collection as Queryable.
/// </summary>
/// <returns></returns>
public IMongoQueryable<TEntity> GetMongoQueryable()
public IQueryable<TEntity> GetMongoQueryable()
{
return Collection.AsQueryable();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System.Linq.Expressions;
using Genocs.Core.CQRS.Queries;
using Genocs.Core.Domain.Entities;
using Genocs.Core.Domain.Repositories;
using Genocs.Persistence.MongoDb.Repositories;
using MongoDB.Driver;
using MongoDB.Driver.Linq;
using System.Linq.Expressions;

namespace Genocs.Persistence.MongoDb.Domain.Repositories;

Expand Down Expand Up @@ -144,7 +144,7 @@ public override void Delete(TKey id)
/// It returns the Mongo Collection as Queryable.
/// </summary>
/// <returns></returns>
public IMongoQueryable<TEntity> GetMongoQueryable()
public IQueryable<TEntity> GetMongoQueryable()
=> Collection.AsQueryable();

public async Task<TEntity> GetAsync(Expression<Func<TEntity, bool>> predicate)
Expand Down
15 changes: 6 additions & 9 deletions src/Genocs.Persistence.MongoDb/Encryptions/AzureInitializer.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
using Genocs.Persistence.MongoDb.Configurations;
using Microsoft.Extensions.Options;
using MongoDB.Bson;
using MongoDB.Driver;
using MongoDB.Driver.Encryption;

namespace Genocs.Persistence.MongoDb.Encryptions;
namespace Genocs.Persistence.MongoDb.Encryptions;

/// <summary>
/// The initializer
/// The initializer.
/// </summary>
public class AzureInitializer
{
/*
/// <summary>
/// Setup the client
/// Setup the client.
/// </summary>
/// <param name="options"></param>
public AutoEncryptionOptions EncryptionOptions(IOptions<MongoDbEncryptionOptions> options)
Expand Down Expand Up @@ -179,4 +174,6 @@ BsonBinaryData CreateKeyGetID(DataKeyOptions options)
//Console.WriteLine("Created encrypted collection!");
// end-create-enc-collection
}

*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MongoDB.Driver" Version="2.30.0" />
<PackageReference Include="MongoDB.Driver.Core.Extensions.DiagnosticSources" Version="1.5.0" />
<PackageReference Include="MongoDB.Driver" Version="3.0.0" />
<PackageReference Include="MongoDB.Driver.Core.Extensions.DiagnosticSources" Version="2.0.0" />
</ItemGroup>

</Project>
12 changes: 6 additions & 6 deletions src/Genocs.Persistence.MongoDb/Repositories/Pagination.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using System.Linq.Expressions;
using Genocs.Core.CQRS.Queries;
using MongoDB.Driver;
using MongoDB.Driver.Linq;
using System.Linq.Expressions;

namespace Genocs.Persistence.MongoDb.Repositories;

public static class Pagination
{
public static async Task<PagedResult<T>> PaginateAsync<T>(
this IMongoQueryable<T> collection,
this IQueryable<T> collection,
IPagedQuery query)
=> await collection.PaginateAsync(
query.OrderBy,
Expand All @@ -17,7 +17,7 @@ public static async Task<PagedResult<T>> PaginateAsync<T>(
query.Results);

public static async Task<PagedResult<T>> PaginateAsync<T>(
this IMongoQueryable<T> collection,
this IQueryable<T> collection,
string? orderBy,
string? sortOrder,
int page = 1,
Expand Down Expand Up @@ -61,11 +61,11 @@ public static async Task<PagedResult<T>> PaginateAsync<T>(
return PagedResult<T>.Create(data, page, resultsPerPage, totalPages, totalResults);
}

public static IMongoQueryable<T> Limit<T>(this IMongoQueryable<T> collection, IPagedQuery query)
public static IQueryable<T> Limit<T>(this IQueryable<T> collection, IPagedQuery query)
=> collection.Limit(query.Page, query.Results);

public static IMongoQueryable<T> Limit<T>(
this IMongoQueryable<T> collection,
public static IQueryable<T> Limit<T>(
this IQueryable<T> collection,
int page = 1,
int resultsPerPage = 10)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.4.9" />
<PackageReference Include="xunit" Version="2.9.2" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
2 changes: 1 addition & 1 deletion src/Genocs.Tracing/Genocs.Tracing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.10.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.10.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.10.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.9.0" />
<PackageReference Include="Polly" Version="8.5.0" />
</ItemGroup>
Expand Down