last ...
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using xCategoryService.Interfaces.Dtos;
|
||||
using xCategoryService.Models.Dtos;
|
||||
using xCategoryService.Models.Entities;
|
||||
using xPushService.Base;
|
||||
|
||||
namespace xCategoryService.Providers.Dtos
|
||||
{
|
||||
public class XCategoryDtoHub : XBaseDtoHub<XCategory, XCategoryDto, int>, IXCategoryDtoHub
|
||||
{
|
||||
public XCategoryDtoHub(
|
||||
ILogger<XCategoryDtoHub> logger
|
||||
) : base(logger)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System.Collections.Generic;
|
||||
using AutoMapper;
|
||||
using xCategoryService.Interfaces.Dtos;
|
||||
using xCategoryService.Interfaces.Entities;
|
||||
using xCategoryService.Models.Dtos;
|
||||
using xCategoryService.Models.Entities;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xCategoryService.Providers.Dtos
|
||||
{
|
||||
public class XCategoryRepositoryService : XBaseRepositoryService<XCategory, XCategoryDto, int>, IXCategoryRepositoryService
|
||||
{
|
||||
public XCategoryRepositoryService(
|
||||
IXCategoryRepository repository,
|
||||
IEnumerable<Profile> mapperProfiles = null
|
||||
) : base(
|
||||
repository,
|
||||
mapperProfiles
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using xCategoryService.Interfaces.Dtos;
|
||||
using xCategoryService.Models.Dtos;
|
||||
using xCategoryService.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xIdentityService.Interfaces;
|
||||
using xPushService.Base;
|
||||
|
||||
namespace xCategoryService.Providers.Dtos
|
||||
{
|
||||
public class XCategoryServiceProvider : XBaseDtoProvider<XCategory, XCategoryDto, int, XCategoryDtoHub>, IXCategoryServiceProvider
|
||||
{
|
||||
public XCategoryServiceProvider(
|
||||
IHubContext<XCategoryDtoHub> hub,
|
||||
XDataServiceConfiguration dataConfiguration,
|
||||
IXCategoryRepositoryService service,
|
||||
IXIdentityProvider identityProvider = null
|
||||
) : base(
|
||||
hub,
|
||||
dataConfiguration,
|
||||
service,
|
||||
identityProvider
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using xCategoryService.Interfaces.Entities;
|
||||
using xCategoryService.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.Db;
|
||||
using xDataService.Interfaces;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xCategoryService.Providers.Entities
|
||||
{
|
||||
public class XCategoryEFRepository<TContext> : XBaseEFRepository<XCategory, int, TContext>, IXCategoryRepository
|
||||
where TContext : XDbContext
|
||||
{
|
||||
public XCategoryEFRepository(
|
||||
IXUnitOfWorks<TContext> unitOfWorks,
|
||||
XDataServiceConfiguration configuration,
|
||||
IXCategoryKeyGenerator keyGenerator = null,
|
||||
IXCategoryRepositoryEvents baseRepositoryEvents = null
|
||||
) : base(
|
||||
unitOfWorks,
|
||||
configuration,
|
||||
keyGenerator,
|
||||
baseRepositoryEvents
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using xCategoryService.Interfaces.Entities;
|
||||
using xCategoryService.Models.Entities;
|
||||
using xPushService.Base;
|
||||
|
||||
namespace xCategoryService.Providers.Entities
|
||||
{
|
||||
public class XCategoryEntityHub : XBaseEntityHub<XCategory, int>, IXCategoryEntityHub
|
||||
{
|
||||
public XCategoryEntityHub(
|
||||
ILogger<XCategoryEntityHub> logger
|
||||
) : base(logger)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using xCategoryService.Interfaces.Entities;
|
||||
using xCategoryService.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xCategoryService.Providers.Entities
|
||||
{
|
||||
public class XCategoryInMemoryRepository : XBaseInMemoryRepository<XCategory, int>, IXCategoryRepository
|
||||
{
|
||||
public XCategoryInMemoryRepository(
|
||||
XDataServiceConfiguration configuration,
|
||||
IXCategoryKeyGenerator keyGenerator = null,
|
||||
IXCategoryRepositoryEvents baseRepositoryEvents = null
|
||||
) : base(
|
||||
configuration,
|
||||
keyGenerator,
|
||||
baseRepositoryEvents
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using xCategoryService.Interfaces.Entities;
|
||||
using xCategoryService.Models.Entities;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xCategoryService.Providers.Entities
|
||||
{
|
||||
public class XCategoryKeyGenerator : XIntKeyGenerator<XCategory>, IXCategoryKeyGenerator
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using xCategoryService.Interfaces.Entities;
|
||||
using xCategoryService.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xCategoryService.Providers.Entities
|
||||
{
|
||||
public class XCategoryMongoRepository : XBaseMongoRepository<XCategory, int>, IXCategoryRepository
|
||||
{
|
||||
public XCategoryMongoRepository(
|
||||
XDataBaseConfiguration dbConfiguration,
|
||||
XDataServiceConfiguration configuration,
|
||||
string collectionName = null,
|
||||
IXCategoryKeyGenerator keyGenerator = null,
|
||||
IXCategoryRepositoryEvents baseRepositoryEvents = null
|
||||
) : base(
|
||||
dbConfiguration,
|
||||
configuration,
|
||||
collectionName,
|
||||
keyGenerator,
|
||||
baseRepositoryEvents
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using xCategoryService.Interfaces.Entities;
|
||||
using xCategoryService.Models.Entities;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xCategoryService.Providers.Entities
|
||||
{
|
||||
public class XCategoryRepositoryEvents : XBaseRepositoryEvents<XCategory>, IXCategoryRepositoryEvents
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using xCategoryService.Interfaces.Entities;
|
||||
using xCategoryService.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xIdentityService.Interfaces;
|
||||
using xPushService.Base;
|
||||
|
||||
namespace xCategoryService.Providers.Entities
|
||||
{
|
||||
public class XCategoryRepositoryProvider : XBaseEntityProvider<XCategory, int, XCategoryEntityHub>, IXCategoryRepositoryProvider
|
||||
{
|
||||
public XCategoryRepositoryProvider(
|
||||
IHubContext<XCategoryEntityHub> hub,
|
||||
IXCategoryRepository repository,
|
||||
XDataServiceConfiguration dataConfiguration,
|
||||
IXIdentityProvider identityProvider = null
|
||||
) : base(
|
||||
hub,
|
||||
repository,
|
||||
dataConfiguration,
|
||||
identityProvider
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using xCategoryService.Interfaces.Entities;
|
||||
using xCategoryService.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.GraphQL;
|
||||
|
||||
namespace xCategoryService.Providers.GraphQL
|
||||
{
|
||||
public class XCategoryGraphQLTypeHelper : XBaseGraphQLTypeHelper<XCategory, int>, IXCategoryGraphQLTypeHelper
|
||||
{
|
||||
public XCategoryGraphQLTypeHelper(
|
||||
XDataServiceConfiguration configuration
|
||||
) : base(configuration)
|
||||
{ }
|
||||
|
||||
public override string GetInQueryCollectionName()
|
||||
{
|
||||
return "categories";
|
||||
}
|
||||
|
||||
public override string GetInQuerySingleName()
|
||||
{
|
||||
return "category";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using GraphQL.Types;
|
||||
using xCategoryService.Interfaces.Entities;
|
||||
using xCategoryService.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.GraphQL;
|
||||
|
||||
namespace xCategoryService.Providers.GraphQL
|
||||
{
|
||||
public class XCategoryGraphQuery : XBaseGraphQLQuery<XCategory, int, XCategoryGraphType, IntGraphType>
|
||||
{
|
||||
public XCategoryGraphQuery(
|
||||
XDataServiceConfiguration configuration,
|
||||
IXCategoryRepository repository,
|
||||
IXCategoryGraphQLTypeHelper helper
|
||||
) : base(
|
||||
configuration,
|
||||
repository,
|
||||
helper
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using GraphQL.Types;
|
||||
|
||||
namespace xCategoryService.Providers.GraphQL
|
||||
{
|
||||
public class XCategoryGraphSchema : Schema
|
||||
{
|
||||
public XCategoryGraphSchema(IServiceProvider services) : base(services)
|
||||
{
|
||||
Query = (XCategoryGraphQuery)services.GetService(typeof(XCategoryGraphQuery));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using xCategoryService.Models.Entities;
|
||||
using xDataService.GraphQL;
|
||||
|
||||
namespace xCategoryService.Providers.GraphQL
|
||||
{
|
||||
public class XCategoryGraphType : XBaseGraphObjectType<XCategory, int>
|
||||
{
|
||||
public XCategoryGraphType() : base()
|
||||
{
|
||||
Field(x => x.Title);
|
||||
Field(x => x.Description);
|
||||
Field(x => x.References);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using xCategoryService.Interfaces.Entities;
|
||||
using xCategoryService.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.GraphQL;
|
||||
using xDataService.Interfaces;
|
||||
|
||||
namespace xCategoryService.Providers.GraphQL
|
||||
{
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
using xCategoryService.Interfaces;
|
||||
using xStringService.Interfaces.Dtos;
|
||||
using xStringService.Providers;
|
||||
|
||||
namespace xCategoryService.Providers
|
||||
{
|
||||
public class XCategoryDescriptionResourceProvider : XBaseItemResourceProvider, IXCategoryDescriptionResourceProvider
|
||||
{
|
||||
public XCategoryDescriptionResourceProvider(
|
||||
IXStringServiceProvider stringProvider
|
||||
) : base(
|
||||
item: "CatD",
|
||||
stringProvider
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using xCategoryService.Configurations.Entities;
|
||||
using xCategoryService.Models.Entities;
|
||||
using xDataService.Interfaces;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xCategoryService.Providers
|
||||
{
|
||||
public class XCategoryEntityRegisterar : XBaseEntityRegisterar, IXEntityRegisterar
|
||||
{
|
||||
public XCategoryEntityRegisterar()
|
||||
: base(nameof(XCategoryEntityRegisterar))
|
||||
{
|
||||
//
|
||||
// Add XCategory Entity ...
|
||||
AddEntity<XCategory, int>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configure Entities ...
|
||||
/// </summary>
|
||||
/// <param name="modelBuilder"></param>
|
||||
public override void ConfigureEntities(ModelBuilder modelBuilder)
|
||||
{
|
||||
//
|
||||
// Configure Entity Using Provided ...
|
||||
modelBuilder
|
||||
.ApplyConfigurationsFromAssembly(typeof(XCategoryEntityConfiguration).Assembly);
|
||||
|
||||
//
|
||||
base.ConfigureEntities(modelBuilder);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using xCategoryService.Interfaces;
|
||||
using xCategoryService.Interfaces.Entities;
|
||||
using xCategoryService.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xCategoryService.Providers
|
||||
{
|
||||
public abstract class XCategorySeederBase : XBaseDbSeeder<XCategory, int>, IXCategorySeeder
|
||||
{
|
||||
protected XCategorySeederBase(
|
||||
string entity,
|
||||
string database,
|
||||
IXCategoryRepository repository,
|
||||
XDataServiceConfiguration dataServiceConfiguration
|
||||
) : base(
|
||||
entity,
|
||||
database,
|
||||
repository,
|
||||
dataServiceConfiguration
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using xCategoryService.Interfaces;
|
||||
using xStringService.Interfaces.Dtos;
|
||||
using xStringService.Providers;
|
||||
|
||||
namespace xCategoryService.Providers
|
||||
{
|
||||
public class XCategoryTitleResourceProvider : XBaseItemResourceProvider, IXCategoryTitleResourceProvider
|
||||
{
|
||||
public XCategoryTitleResourceProvider(
|
||||
IXStringServiceProvider stringProvider
|
||||
) : base(
|
||||
item: "CatT",
|
||||
stringProvider
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,6 @@ namespace xCategoryService.Providers
|
||||
public class XSubCategoryDescriptionResourceProvider : XBaseItemResourceProvider, IXSubCategoryDescriptionResourceProvider
|
||||
{
|
||||
public XSubCategoryDescriptionResourceProvider(
|
||||
string item,
|
||||
IXStringServiceProvider stringProvider
|
||||
) : base(
|
||||
item: "SubCatD",
|
||||
|
||||
Reference in New Issue
Block a user