Compare commits

...
8 Commits
Author SHA1 Message Date
saherelm 41e76a59da remove commented codes ... 2026-10-02 00:07:01 +03:30
saherelm 3560de8e63 last ... 2026-09-28 22:36:34 +03:30
saherelm 057d891a32 apply sorting ... 2026-09-06 00:20:06 +03:30
saherelm cc8f3fdd1b sort usings ... 2026-09-03 23:57:24 +03:30
saherelm a0709b702c kast ... 2026-09-03 10:33:17 +03:30
saherelm b9fced926b cleanup nuget source ... 2026-08-15 17:24:01 +03:30
saherelm 9e8fc9a510 last ... 2026-08-10 22:55:49 +03:30
saherelm 2b17be0575 Add Repository Descriptor Builder ... 2026-08-08 18:07:55 +03:30
61 changed files with 448 additions and 258 deletions
+196
View File
@@ -0,0 +1,196 @@
using xModels.Base;
using GraphQL.Types;
using xDataService.Db;
using xDataService.Models;
using xDataService.GraphQL;
using xDataService.Providers;
using xDataService.Interfaces;
namespace xDataService.Builders
{
/// <summary>
/// Fluent Builder for constructing XRepositoryDescriptor instances.
/// Replaces the telescoping generic constructors (12-17 type parameters)
/// with a readable, chainable API.
/// </summary>
/// <typeparam name="TEntity">The entity type</typeparam>
/// <typeparam name="TKey">The entity key type</typeparam>
/// <example>
/// var descriptor = XRepositoryDescriptor.For&lt;XAiMessage, Guid&gt;()
/// .WithKeyGenerator&lt;IXAiMessageKeyGenerator, XAiMessageKeyGenerator&gt;()
/// .WithEvents&lt;IXAiMessageRepositoryEvents, XAiMessageRepositoryEvents&gt;()
/// .WithGraphQL&lt;XAiMessageGraphType, GuidGraphType, XAiMessageGraphQuery,
/// IXAiMessageGraphQLTypeHelper, XAiMessageGraphQLTypeHelper, XAiMessageGraphSchema&gt;()
/// .WithEFRepository&lt;XAiApiDbContext, IXAiMessageRepository, XAiMessageEFRepository&lt;XAiApiDbContext&gt;&gt;()
/// .WithSeeder&lt;IXAiMessageSeeder, XAiMessageSeeder&gt;()
/// .Build();
/// </example>
public sealed class XRepositoryDescriptorBuilder<TEntity, TKey>
where TEntity : XBaseEntity<TKey>
{
private readonly XRepositoryDescriptor _descriptor;
private XRepositoryDescriptorBuilder()
{
_descriptor = new XRepositoryDescriptor
{
Entity = typeof(TEntity),
Key = typeof(TKey)
};
}
/// <summary>
/// Creates a new builder instance for the specified entity and key types.
/// </summary>
public static XRepositoryDescriptorBuilder<TEntity, TKey> Create()
{
return new XRepositoryDescriptorBuilder<TEntity, TKey>();
}
//
#region KeyGenerator
/// <summary>
/// Configures the Key Generator service for the entity.
/// </summary>
/// <typeparam name="TKeyGeneratorService">The key generator interface</typeparam>
/// <typeparam name="TKeyGeneratorImplementation">The key generator implementation</typeparam>
public XRepositoryDescriptorBuilder<TEntity, TKey> WithKeyGenerator<TKeyGeneratorService, TKeyGeneratorImplementation>()
where TKeyGeneratorService : IXKeyGenerator<TEntity, TKey>
where TKeyGeneratorImplementation : XKeyGenerator<TEntity, TKey>
{
_descriptor.KeyGeneratorService = typeof(TKeyGeneratorService);
_descriptor.KeyGeneratorImplementation = typeof(TKeyGeneratorImplementation);
return this;
}
#endregion
//
#region Events
/// <summary>
/// Configures the Repository Events service for the entity.
/// </summary>
/// <typeparam name="TEventsService">The events interface</typeparam>
/// <typeparam name="TEventsImplementation">The events implementation</typeparam>
public XRepositoryDescriptorBuilder<TEntity, TKey> WithEvents<TEventsService, TEventsImplementation>()
where TEventsService : IXBaseRepositoryEvents<TEntity>
where TEventsImplementation : XBaseRepositoryEvents<TEntity>
{
_descriptor.EventsService = typeof(TEventsService);
_descriptor.EventsImplementation = typeof(TEventsImplementation);
return this;
}
#endregion
//
#region GraphQL
/// <summary>
/// Configures the full GraphQL stack for the entity.
/// </summary>
/// <typeparam name="TGraph">The GraphQL object type</typeparam>
/// <typeparam name="TGraphKey">The GraphQL key type</typeparam>
/// <typeparam name="TGraphQuery">The GraphQL query type</typeparam>
/// <typeparam name="TGraphTypeHelperService">The GraphQL type helper interface</typeparam>
/// <typeparam name="TGraphTypeHelperImplementation">The GraphQL type helper implementation</typeparam>
/// <typeparam name="TGraphSchema">The GraphQL schema</typeparam>
public XRepositoryDescriptorBuilder<TEntity, TKey> WithGraphQL<
TGraph,
TGraphKey,
TGraphQuery,
TGraphTypeHelperService,
TGraphTypeHelperImplementation,
TGraphSchema>()
where TGraphSchema : Schema
where TGraphKey : IGraphType
where TGraph : XBaseGraphObjectType<TEntity, TKey>
where TGraphTypeHelperService : IXBaseGraphQLTypeHelper<TEntity, TKey>
where TGraphQuery : XBaseGraphQLQuery<TEntity, TKey, TGraph, TGraphKey>
where TGraphTypeHelperImplementation : XBaseGraphQLTypeHelper<TEntity, TKey>
{
_descriptor.GraphType = typeof(TGraph);
_descriptor.GraphTypeKey = typeof(TGraphKey);
_descriptor.GraphQuery = typeof(TGraphQuery);
_descriptor.GraphSchema = typeof(TGraphSchema);
_descriptor.GraphTypeHelperService = typeof(TGraphTypeHelperService);
_descriptor.GraphTypeHelperImplementation = typeof(TGraphTypeHelperImplementation);
return this;
}
#endregion
//
#region Repository
/// <summary>
/// Configures an Entity Framework Core repository for the entity.
/// </summary>
/// <typeparam name="TContext">The EF DbContext</typeparam>
/// <typeparam name="TRepositoryService">The repository interface</typeparam>
/// <typeparam name="TRepositoryImplementation">The repository implementation</typeparam>
public XRepositoryDescriptorBuilder<TEntity, TKey> WithEFRepository<TContext, TRepositoryService, TRepositoryImplementation>()
where TContext : XDbContext
where TRepositoryService : IXBaseRepository<TEntity, TKey>
where TRepositoryImplementation : XBaseEFRepository<TEntity, TKey, TContext>
{
_descriptor.Context = typeof(TContext);
_descriptor.RepositoryService = typeof(TRepositoryService);
_descriptor.RepositoryImplementation = typeof(TRepositoryImplementation);
return this;
}
/// <summary>
/// Configures a MongoDB repository for the entity.
/// </summary>
/// <typeparam name="TRepositoryService">The repository interface</typeparam>
/// <typeparam name="TRepositoryImplementation">The repository implementation</typeparam>
public XRepositoryDescriptorBuilder<TEntity, TKey> WithMongoRepository<TRepositoryService, TRepositoryImplementation>()
where TRepositoryService : IXBaseRepository<TEntity, TKey>
where TRepositoryImplementation : XBaseMongoRepository<TEntity, TKey>
{
_descriptor.RepositoryService = typeof(TRepositoryService);
_descriptor.RepositoryImplementation = typeof(TRepositoryImplementation);
return this;
}
/// <summary>
/// Configures an In-Memory repository for the entity.
/// </summary>
/// <typeparam name="TRepositoryService">The repository interface</typeparam>
/// <typeparam name="TRepositoryImplementation">The repository implementation</typeparam>
public XRepositoryDescriptorBuilder<TEntity, TKey> WithInMemoryRepository<TRepositoryService, TRepositoryImplementation>()
where TRepositoryService : IXBaseRepository<TEntity, TKey>
where TRepositoryImplementation : XBaseInMemoryRepository<TEntity, TKey>
{
_descriptor.RepositoryService = typeof(TRepositoryService);
_descriptor.RepositoryImplementation = typeof(TRepositoryImplementation);
return this;
}
#endregion
//
#region Seeder
/// <summary>
/// Configures the database seeder for the entity.
/// </summary>
/// <typeparam name="TSeederService">The seeder interface</typeparam>
/// <typeparam name="TSeederImplementation">The seeder implementation</typeparam>
public XRepositoryDescriptorBuilder<TEntity, TKey> WithSeeder<TSeederService, TSeederImplementation>()
where TSeederService : IXBaseDbSeeder<TEntity, TKey>
where TSeederImplementation : XBaseDbSeeder<TEntity, TKey>
{
_descriptor.SeederService = typeof(TSeederService);
_descriptor.SeederImplementation = typeof(TSeederImplementation);
return this;
}
#endregion
//
#region Build
/// <summary>
/// Builds and returns the configured XRepositoryDescriptor.
/// </summary>
/// <returns>The fully configured descriptor</returns>
public XRepositoryDescriptor Build()
{
return _descriptor;
}
#endregion
}
}
+1 -1
View File
@@ -1,5 +1,5 @@
using System.Collections.Generic;
using xDataService.Constants;
using System.Collections.Generic;
namespace xDataService.Configuration
{
+1 -1
View File
@@ -1,5 +1,5 @@
using System.Collections.Generic;
using xDataService.Constants;
using System.Collections.Generic;
namespace xDataService.Configuration
{
+11 -11
View File
@@ -1,20 +1,20 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using xCommons.Configurations;
using xCommons.Extensions;
using xCommons.Providers;
using xExceptions.Constants;
using System.Linq;
using xModels.Base;
using xModels.Dtos;
using xDataService.Interfaces;
using System.Linq;
using Microsoft.EntityFrameworkCore.Query;
using System.Threading;
using xCommons.Providers;
using xCommons.Extensions;
using xCommons.Controllers;
using xExceptions.Constants;
using System.Threading.Tasks;
using xCommons.Configurations;
using xDataService.Interfaces;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using Microsoft.Extensions.Logging;
using Microsoft.AspNetCore.Authorization;
using Microsoft.EntityFrameworkCore.Query;
namespace xDataService.Controllers
{
+13 -13
View File
@@ -1,20 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore.Query;
using Microsoft.Extensions.Logging;
using xCommons.Configurations;
using xCommons.Controllers;
using xCommons.Extensions;
using xCommons.Providers;
using xDataService.Interfaces;
using xExceptions.Constants;
using xModels.Base;
using xModels.Dtos;
using System.Threading;
using xCommons.Providers;
using xCommons.Extensions;
using xCommons.Controllers;
using xExceptions.Constants;
using System.Threading.Tasks;
using xCommons.Configurations;
using xDataService.Interfaces;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using Microsoft.Extensions.Logging;
using Microsoft.AspNetCore.Authorization;
using Microsoft.EntityFrameworkCore.Query;
namespace xDataService.Controllers
{
+11 -11
View File
@@ -1,19 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using xCommons.Helpers;
using xCommons.Extensions;
using xDataService.Models;
using xDataService.Helpers;
using xExceptions.Constants;
using xDataService.Constants;
using xDataService.Providers;
using xDataService.Extensions;
using System.Collections.Generic;
using xDataService.Configuration;
using Microsoft.AspNetCore.Builder;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using xCommons.Extensions;
using xCommons.Helpers;
using xDataService.Configuration;
using xDataService.Constants;
using xDataService.Extensions;
using xDataService.Helpers;
using xDataService.Models;
using xDataService.Providers;
using xExceptions.Constants;
using Microsoft.EntityFrameworkCore.Infrastructure;
namespace xDataService.DI
{
+2 -3
View File
@@ -1,10 +1,9 @@
using System;
using System.Linq;
using Microsoft.EntityFrameworkCore;
using xCommons.Extensions;
using xDataService.Configuration;
using xDataService.Helpers;
using xDataService.Providers;
using xDataService.Configuration;
using Microsoft.EntityFrameworkCore;
namespace xDataService.Db
{
+2 -2
View File
@@ -1,8 +1,8 @@
using xModels.Base;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using xDataService.Interfaces;
using xModels.Base;
using Microsoft.EntityFrameworkCore;
namespace xDataService.Db {
/// <summary>
+1 -1
View File
@@ -1,6 +1,6 @@
using System;
using Microsoft.EntityFrameworkCore.Infrastructure;
using MySql.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Infrastructure;
namespace xDataService.Extensions {
public static class DbContextOptionExtensions {
+3 -3
View File
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using xCommons.Extensions;
using xModels.Base;
using xCommons.Extensions;
using System.Linq.Expressions;
using System.Collections.Generic;
namespace xDataService.Extensions {
public static class EntityExtensions {
+14 -9
View File
@@ -1,16 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using xCommons.Extensions;
using xDataService.Configuration;
using xDataService.Constants;
using xExceptions.Constants;
using xModels.Base;
using xModels.Dtos;
using System.Reflection;
using xCommons.Extensions;
using xExceptions.Constants;
using System.Threading.Tasks;
using xDataService.Constants;
using System.Linq.Expressions;
using System.Collections.Generic;
using xDataService.Configuration;
using Microsoft.EntityFrameworkCore;
namespace xDataService.Extensions
{
@@ -22,6 +22,7 @@ namespace xDataService.Extensions
/// <param name="source"></param>
/// <param name="filter"></param>
/// <typeparam name="T"></typeparam>
/// <typeparam name="TKey"></typeparam>
/// <returns></returns>
public static IQueryable<T> ApplyFilter<T, TKey>(
this IQueryable<T> source,
@@ -40,6 +41,7 @@ namespace xDataService.Extensions
/// <param name="source"></param>
/// <param name="filter"></param>
/// <typeparam name="T"></typeparam>
/// <typeparam name="TKey"></typeparam>
/// <returns></returns>
public static async Task<IQueryable<T>> ApplyFilterAsync<T, TKey>(
this IQueryable<T> source,
@@ -84,6 +86,7 @@ namespace xDataService.Extensions
/// <param name="source"></param>
/// <param name="filter"></param>
/// <typeparam name="T"></typeparam>
/// <typeparam name="TKey"></typeparam>
/// <returns></returns>
public static async Task<IEnumerable<T>> ApplyFilterAsync<T, TKey>(
this IEnumerable<T> source,
@@ -319,6 +322,7 @@ namespace xDataService.Extensions
/// <param name="isAscending"></param>
/// <param name="columnsMap"></param>
/// <typeparam name="T"></typeparam>
/// <typeparam name="TKey"></typeparam>
/// <returns></returns>
public static IQueryable<T> ApplySorting<T, TKey>(
this IQueryable<T> source,
@@ -372,6 +376,7 @@ namespace xDataService.Extensions
/// <param name="isAscending"></param>
/// <param name="columnsMap"></param>
/// <typeparam name="T"></typeparam>
/// <typeparam name="TKey"></typeparam>
/// <returns></returns>
public static IEnumerable<T> ApplySorting<T, TKey>(
this IEnumerable<T> source,
@@ -1,7 +1,7 @@
using System.Linq;
using xCommons.Extensions;
using xDataService.Configuration;
using xDataService.Constants;
using xDataService.Configuration;
namespace xDataService.Extensions {
public static class XDataServiceConfigurationExtensions {
+1 -1
View File
@@ -1,6 +1,6 @@
using xCommons.Extensions;
using xDataService.Constants;
using xDataService.Models;
using xDataService.Constants;
namespace xDataService.Extensions
{
+1 -1
View File
@@ -1,7 +1,7 @@
using GraphQL;
using xModels.Dtos;
using GraphQL.Types;
using xDataService.Constants;
using xModels.Dtos;
namespace xDataService.Extensions {
public static class XGraphQLExtensions {
+2 -8
View File
@@ -1,16 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using MongoDB.Bson;
using MongoDB.Driver;
using MongoDB.Driver.Core.Bindings;
using MongoDB.Driver.Core.Clusters;
using MongoDB.Driver.Core.Servers;
using MongoDB.Driver.Core.WireProtocol.Messages.Encoders;
using MongoDB.Driver.Linq;
using xDataService.Mongo;
using MongoDB.Driver.Linq;
using System.Collections.Generic;
namespace xDataService.Extensions {
public static class XMongoDbExtensions {
+8 -7
View File
@@ -1,16 +1,16 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using xCommons.Extensions;
using xDataService.Models;
using System.ComponentModel;
using System.Collections.Generic;
namespace xDataService.Extensions
{
public static class XReferenceExtensions
{
/// <summary>
/// Converts an XReference<T> to String Representation ...
/// Converts an XReference to String Representation ...
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="source"></param>
@@ -42,7 +42,7 @@ namespace xDataService.Extensions
}
/// <summary>
/// Parse an String and Extract to XReference<T> if it's Described ...
/// Parse an String and Extract to XReference if it's Described ...
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="source"></param>
@@ -75,7 +75,8 @@ namespace xDataService.Extensions
try
{
referencedTo = (T)Convert.ChangeType(parts[1], typeof(T));
} catch
}
catch
{
referencedTo = (T)TypeDescriptor.GetConverter(typeof(T)).ConvertFrom(parts[1]);
}
@@ -96,7 +97,7 @@ namespace xDataService.Extensions
}
/// <summary>
/// Converts a Collection of XReference<T> to it's String Representation ...
/// Converts a Collection of XReference to it's String Representation ...
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="source"></param>
@@ -150,7 +151,7 @@ namespace xDataService.Extensions
}
/// <summary>
/// Parse an string to XReference<T> Collection Representation ...
/// Parse an string to XReference Collection Representation ...
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="source"></param>
@@ -1,9 +1,9 @@
using xCommons.Extensions;
using xModels.Base;
using xDataService.Db;
using xDataService.Interfaces;
using xCommons.Extensions;
using xDataService.Models;
using xDataService.Providers;
using xModels.Base;
using xDataService.Interfaces;
namespace xDataService.Extensions
{
+2 -1
View File
@@ -1,11 +1,12 @@
using GraphQL.Types;
using xModels.Base;
using GraphQL.Types;
namespace xDataService.GraphQL
{
/// <summary>
/// Base Entity GraphType Object ...
/// </summary>
/// <typeparam name="TEntity"></typeparam>
/// <typeparam name="TKey"></typeparam>
public abstract class XBaseGraphObjectType<TEntity, TKey> : ObjectGraphType<TEntity>
where TEntity : XBaseEntity<TKey> {
+1 -1
View File
@@ -1,6 +1,6 @@
using xModels.Base;
using GraphQL.Types;
using xDataService.Models;
using xModels.Base;
namespace xDataService.GraphQL {
public class XBaseGraphQLEventType<TEntity, TKey, TGraphType> : ObjectGraphType<XBaseEventModel<TEntity>>
+4 -4
View File
@@ -1,13 +1,13 @@
using System;
using System.Linq.Expressions;
using xModels.Base;
using GraphQL.Types;
using xCommons.Extensions;
using xDataService.Configuration;
using xDataService.Models;
using xDataService.Constants;
using System.Linq.Expressions;
using xDataService.Extensions;
using xDataService.Interfaces;
using xDataService.Models;
using xModels.Base;
using xDataService.Configuration;
namespace xDataService.GraphQL
{
+4 -4
View File
@@ -1,11 +1,11 @@
using System.Collections.Generic;
using GraphQL.Resolvers;
using xModels.Base;
using GraphQL.Types;
using GraphQL.Resolvers;
using xCommons.Extensions;
using xDataService.Models;
using xDataService.Providers;
using xDataService.Interfaces;
using xDataService.Models;
using xModels.Base;
using System.Collections.Generic;
namespace xDataService.GraphQL {
public abstract class XBaseGraphQLSubscription<TEntity, TKey, TGraph> : ObjectGraphType
+3 -3
View File
@@ -1,7 +1,7 @@
using xCommons.Extensions;
using xDataService.Configuration;
using xDataService.Interfaces;
using xModels.Base;
using xCommons.Extensions;
using xDataService.Interfaces;
using xDataService.Configuration;
namespace xDataService.GraphQL
{
+1 -1
View File
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using xCommons.Extensions;
using System.Collections.Generic;
namespace xDataService.Helpers {
public partial class XCursorHelper {
+19 -19
View File
@@ -1,28 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using GraphQL;
using GraphQL.Server;
using GraphQL.Server.Ui.Playground;
using GraphQL.Server.Ui.Voyager;
using System.Linq;
using xModels.Base;
using GraphQL.Types;
using GraphQL.Server;
using xDataService.Db;
using System.Reflection;
using xCommons.Extensions;
using xDataService.Models;
using xDataService.GraphQL;
using xExceptions.Constants;
using xDataService.Constants;
using xDataService.Providers;
using xDataService.Extensions;
using xDataService.Interfaces;
using GraphQL.Server.Ui.Voyager;
using System.Collections.Generic;
using MongoDB.Bson.Serialization;
using GraphQL.Server.Ui.Playground;
using Microsoft.AspNetCore.Builder;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using MongoDB.Bson.Serialization;
using MongoDB.Bson.Serialization.Conventions;
using MySql.EntityFrameworkCore.Extensions;
using xCommons.Extensions;
using xDataService.Constants;
using xDataService.Db;
using xDataService.Extensions;
using xDataService.GraphQL;
using xDataService.Interfaces;
using xDataService.Models;
using xDataService.Providers;
using xExceptions.Constants;
using xModels.Base;
using MongoDB.Bson.Serialization.Conventions;
using Microsoft.Extensions.DependencyInjection;
namespace xDataService.Helpers
{
+1 -1
View File
@@ -1,6 +1,6 @@
using xModels.Dtos;
using GraphQL.Types;
using xDataService.Models;
using xModels.Dtos;
namespace xDataService.Constants {
public static class XGraphQLHelper {
+1 -1
View File
@@ -1,6 +1,6 @@
using xModels.Base;
using System.Threading.Tasks;
using xDataService.Configuration;
using xModels.Base;
namespace xDataService.Interfaces
{
+1 -1
View File
@@ -1,6 +1,6 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using System.Collections.Generic;
namespace xDataService.Interfaces
{
+1 -1
View File
@@ -1,5 +1,5 @@
using GraphQL.Types;
using xModels.Base;
using GraphQL.Types;
namespace xDataService.Interfaces
{
+4 -4
View File
@@ -1,8 +1,8 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using xDataService.Models;
using xModels.Dtos;
using System.Threading;
using xDataService.Models;
using System.Threading.Tasks;
using System.Collections.Generic;
namespace xDataService.Interfaces
{
+5 -6
View File
@@ -1,13 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore.Query;
using xModels.Base;
using xModels.Dtos;
using System.Threading;
using System.Threading.Tasks;
using System.Linq.Expressions;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore.Query;
namespace xDataService.Interfaces
{
+3 -4
View File
@@ -1,12 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using xModels.Base;
using xModels.Dtos;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore.Query;
using xModels.Base;
using xModels.Dtos;
namespace xDataService.Interfaces
{
@@ -14,7 +14,6 @@ namespace xDataService.Interfaces
/// an Interface for Base Repository Actions Providing Using Controllers ...
/// </summary>
/// <typeparam name="TEntity"></typeparam>
/// <typeparam name="TDto"></typeparam>
/// <typeparam name="TKey"></typeparam>
public interface IXBaseRepositoryController<TEntity, TKey>
where TEntity : XBaseEntity<TKey>
+1 -1
View File
@@ -1,6 +1,6 @@
using System;
using System.Collections.Generic;
using xDataService.Models;
using System.Collections.Generic;
namespace xDataService.Interfaces {
public interface IXBaseRepositoryEvents<T> {
+6 -7
View File
@@ -1,14 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using AutoMapper;
using Microsoft.EntityFrameworkCore.Query;
using System.Linq;
using xModels.Base;
using xModels.Dtos;
using System.Threading;
using System.Threading.Tasks;
using System.Linq.Expressions;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore.Query;
namespace xDataService.Interfaces
{
+3 -3
View File
@@ -1,12 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using xModels.Base;
using xModels.Dtos;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore.Query;
using xModels.Base;
using xModels.Dtos;
namespace xDataService.Interfaces
{
+6 -6
View File
@@ -1,12 +1,12 @@
using System;
using System.Collections.Generic;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using MongoDB.Bson.Serialization.Conventions;
using xDataService.Configuration;
using xDataService.Constants;
using xDataService.Db;
using xDataService.Models;
using xDataService.Constants;
using System.Collections.Generic;
using xDataService.Configuration;
using Microsoft.Extensions.Configuration;
using MongoDB.Bson.Serialization.Conventions;
using Microsoft.Extensions.DependencyInjection;
namespace xDataService.Interfaces
{
+1 -1
View File
@@ -1,7 +1,7 @@
using System;
using xModels.Base;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using xModels.Base;
namespace xDataService.Interfaces
{
+1 -1
View File
@@ -1,6 +1,6 @@
using xModels.Base;
using System.Threading;
using System.Threading.Tasks;
using xModels.Base;
namespace xDataService.Interfaces
{
+2 -2
View File
@@ -1,9 +1,9 @@
using System;
using xModels.Base;
using xDataService.Db;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using xDataService.Db;
using xModels.Base;
namespace xDataService.Interfaces {
/// <summary>
+7 -7
View File
@@ -1,15 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using MongoDB.Bson.Serialization.Conventions;
using xCommons.Extensions;
using xDataService.Configuration;
using xDataService.Constants;
using xDataService.Db;
using xDataService.DI;
using xCommons.Extensions;
using xDataService.Constants;
using xDataService.Interfaces;
using System.Collections.Generic;
using xDataService.Configuration;
using Microsoft.Extensions.Configuration;
using MongoDB.Bson.Serialization.Conventions;
using Microsoft.Extensions.DependencyInjection;
namespace xDataService.Models
{
+1 -1
View File
@@ -1,5 +1,5 @@
using GraphQL.Types;
using xModels.Dtos;
using GraphQL.Types;
namespace xDataService.Models {
public class XGraphQueryResult<TEntity, TGraph> : ObjectGraphType<XQueryResult<TEntity>>
+1 -1
View File
@@ -1,5 +1,5 @@
using GraphQL.Types;
using xModels.Dtos;
using GraphQL.Types;
namespace xDataService.Models {
public class XGraphQueryType : InputObjectGraphType<XQuery> {
+2 -2
View File
@@ -1,10 +1,10 @@
using System;
using xModels.Base;
using GraphQL.Types;
using xDataService.Db;
using xDataService.GraphQL;
using xDataService.Interfaces;
using xDataService.Providers;
using xModels.Base;
using xDataService.Interfaces;
namespace xDataService.Models
{
+2 -2
View File
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using MongoDB.Driver;
using System.Threading;
using System.Threading.Tasks;
using MongoDB.Driver;
using System.Collections.Generic;
namespace xDataService.Mongo {
public class XAsyncEnumerableAdapter<T> : IAsyncEnumerable<T> {
+2 -2
View File
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using MongoDB.Driver;
using System.Threading;
using System.Threading.Tasks;
using MongoDB.Driver;
using System.Collections.Generic;
namespace xDataService.Mongo {
public class XMongoAsyncCursor<T> : IAsyncCursor<T> {
+7 -7
View File
@@ -1,13 +1,13 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading;
using System.Threading.Tasks;
using MongoDB.Driver;
using MongoDB.Driver.Linq;
using xModels.Base;
using MongoDB.Driver;
using System.Threading;
using System.Collections;
using MongoDB.Driver.Linq;
using System.Threading.Tasks;
using System.Linq.Expressions;
using System.Collections.Generic;
namespace xDataService.Mongo {
public class XMongoQueryable<TEntity, TKey> : IMongoQueryable<TEntity>
+4 -5
View File
@@ -1,12 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using xModels.Base;
using xCommons.Extensions;
using xDataService.Configuration;
using System.Threading.Tasks;
using xDataService.Constants;
using xDataService.Interfaces;
using xModels.Base;
using System.Collections.Generic;
using xDataService.Configuration;
namespace xDataService.Providers
{
+19 -17
View File
@@ -1,21 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using Microsoft.EntityFrameworkCore.Query;
using xCommons.Extensions;
using xDataService.Configuration;
using xDataService.Db;
using xDataService.Extensions;
using xDataService.Interfaces;
using xDataService.Models;
using xModels.Base;
using xModels.Dtos;
using xDataService.Db;
using System.Threading;
using xCommons.Extensions;
using xDataService.Models;
using System.Threading.Tasks;
using System.Linq.Expressions;
using xDataService.Extensions;
using xDataService.Interfaces;
using System.Collections.Generic;
using xDataService.Configuration;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Query;
using Microsoft.EntityFrameworkCore.ChangeTracking;
namespace xDataService.Providers
{
@@ -733,14 +732,17 @@ namespace xDataService.Providers
{
predicator = x => !x.Deleted;
}
var result = (await AsQueryable(
var list = await AsQueryable(
asNoTracking: true,
orderBuilder: null,
predicate: predicator,
includeBuilder: includeBuilder
)
.ToListAsync(cancellationToken))
.FirstOrDefault(predicate.Compile());
.ToListAsync(cancellationToken);
//
var whereClause = predicate.Compile();
var result = list.FirstOrDefault(x => whereClause(x));
//
return result;
+2 -2
View File
@@ -1,8 +1,8 @@
using System;
using xModels.Base;
using xDataService.Interfaces;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using xDataService.Interfaces;
using xModels.Base;
namespace xDataService.Providers
{
+1 -1
View File
@@ -1,6 +1,6 @@
using xModels.Base;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using xModels.Base;
namespace xDataService.Providers
{
+12 -12
View File
@@ -1,19 +1,19 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Query;
using xCommons.Extensions;
using xDataService.Configuration;
using xDataService.Extensions;
using xDataService.Interfaces;
using xDataService.Models;
using xModels.Base;
using xModels.Dtos;
using System.Threading;
using xCommons.Extensions;
using xDataService.Models;
using System.Threading.Tasks;
using System.Linq.Expressions;
using xDataService.Extensions;
using xDataService.Interfaces;
using System.Collections.Generic;
using xDataService.Configuration;
using System.Collections.Concurrent;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Query;
namespace xDataService.Providers
{
+13 -13
View File
@@ -1,20 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Query;
using MongoDB.Driver;
using MongoDB.Driver.Linq;
using xCommons.Extensions;
using xDataService.Configuration;
using xDataService.Extensions;
using xDataService.Interfaces;
using xDataService.Models;
using xModels.Base;
using xModels.Dtos;
using MongoDB.Driver;
using System.Threading;
using MongoDB.Driver.Linq;
using xCommons.Extensions;
using xDataService.Models;
using System.Threading.Tasks;
using System.Linq.Expressions;
using xDataService.Extensions;
using xDataService.Interfaces;
using System.Collections.Generic;
using xDataService.Configuration;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Query;
namespace xDataService.Providers
{
+4 -4
View File
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.Reactive.Linq;
using System.Reactive.Subjects;
using xDataService.Interfaces;
using xDataService.Models;
using System.Reactive.Linq;
using xDataService.Interfaces;
using System.Reactive.Subjects;
using System.Collections.Generic;
namespace xDataService.Providers {
/// <summary>
+9 -12
View File
@@ -1,16 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using AutoMapper;
using Microsoft.EntityFrameworkCore.Query;
using xCommons.Extensions;
using xDataService.Interfaces;
using System.Linq;
using xModels.Base;
using xModels.Dtos;
using System.Threading;
using xCommons.Extensions;
using System.Threading.Tasks;
using System.Linq.Expressions;
using xDataService.Interfaces;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using Microsoft.EntityFrameworkCore.Query;
namespace xDataService.Providers
{
@@ -19,9 +19,6 @@ namespace xDataService.Providers
/// and provides Data Manipulation Methods using Dtos instead of Entities ...
///
/// it can be use of following Repository Patterns Implementation:
/// <see cref="XBaseEFRepository"/>>
/// <see cref="XBaseMongoRepository"/>>
/// <see cref="XBaseInMemoryRepository"/>>
/// </summary>
/// <typeparam name="TEntity"></typeparam>
/// <typeparam name="TDto"></typeparam>
+2 -3
View File
@@ -1,11 +1,11 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using Microsoft.EntityFrameworkCore;
using xCommons.Extensions;
using xDataService.Interfaces;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
namespace xDataService.Providers
{
@@ -51,7 +51,6 @@ namespace xDataService.Providers
{
//
var entityTypes = new List<Type>();
// path = Path.Combine (Directory.GetCurrentDirectory ());
var path = Path.Combine (AppContext.BaseDirectory);
var files = Directory.GetFiles(path, "*.dll");
foreach (var dll in files)
+4 -4
View File
@@ -1,9 +1,9 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using xCommons.Extensions;
using xDataService.Interfaces;
using xModels.Base;
using System.Threading;
using xCommons.Extensions;
using System.Threading.Tasks;
using xDataService.Interfaces;
namespace xDataService.Providers
{
+2 -2
View File
@@ -1,10 +1,10 @@
using System.Linq;
using xModels.Base;
using System.Threading;
using System.Threading.Tasks;
using xCommons.Extensions;
using System.Threading.Tasks;
using xDataService.Extensions;
using xDataService.Interfaces;
using xModels.Base;
namespace xDataService.Providers
{
+1 -1
View File
@@ -1,7 +1,7 @@
using xModels.Base;
using System.Threading;
using System.Threading.Tasks;
using xDataService.Interfaces;
using xModels.Base;
namespace xDataService.Providers
{
+2 -2
View File
@@ -1,10 +1,10 @@
using System.Linq;
using xModels.Base;
using System.Threading;
using System.Threading.Tasks;
using xCommons.Extensions;
using System.Threading.Tasks;
using xDataService.Extensions;
using xDataService.Interfaces;
using xModels.Base;
namespace xDataService.Providers
{
+4 -4
View File
@@ -1,9 +1,9 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using xCommons.Extensions;
using xDataService.Interfaces;
using xModels.Base;
using System.Threading;
using xCommons.Extensions;
using System.Threading.Tasks;
using xDataService.Interfaces;
namespace xDataService.Providers
{
+1 -1
View File
@@ -3,6 +3,6 @@
<packageSources>
<!-- <add key="megan" value="https://hub.megan.ir/nuget/index.json" /> -->
<add key="nuget" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="baget" value="https://nuget.saherelmhub.ir/v3/index.json" protocolVersion="3" disableTLSCertificateValidation="true" />
<!-- <add key="baget" value="https://nuget.saherelmhub.ir/v3/index.json" protocolVersion="3" disableTLSCertificateValidation="true" /> -->
</packageSources>
</configuration>
+3 -3
View File
@@ -20,7 +20,7 @@
<!-- Icon Handling -->
<ItemGroup>
<None Include="../../Resources/Images/favicon.png" Link="icon.png" Pack="true"
<None Include="../../Documents/Resources/Images/favicon.png" Link="icon.png" Pack="true"
PackagePath="\icon.png" />
</ItemGroup>
@@ -71,9 +71,9 @@
<!-- For XML Documentation Support -->
<PropertyGroup>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
</Project>