adding Data Requirement on XContent Service ...
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using xContentService.Interfaces.Dtos;
|
||||
using xContentService.Models.Dtos;
|
||||
using xContentService.Models.Entities;
|
||||
using xPushService.Base;
|
||||
|
||||
namespace xContentService.Providers.Dtos
|
||||
{
|
||||
public class XContentDtoHub : XBaseDtoHub<XContent, XContentDto, Guid>, IXContentDtoHub
|
||||
{
|
||||
public XContentDtoHub(
|
||||
ILogger<XContentDtoHub> logger
|
||||
) : base(logger)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using AutoMapper;
|
||||
using xContentService.Interfaces.Dtos;
|
||||
using xContentService.Interfaces.Entities;
|
||||
using xContentService.Models.Dtos;
|
||||
using xContentService.Models.Entities;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xContentService.Providers.Dtos
|
||||
{
|
||||
public class XContentRepositoryService : XBaseRepositoryService<XContent, XContentDto, Guid>, IXContentRepositoryService
|
||||
{
|
||||
public XContentRepositoryService(
|
||||
IXContentRepository repository,
|
||||
IEnumerable<Profile> mapperProfiles = null
|
||||
) : base(
|
||||
repository,
|
||||
mapperProfiles
|
||||
)
|
||||
{ }
|
||||
|
||||
//
|
||||
// TODO: Implement Enrichers ...
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using xContentService.Interfaces.Dtos;
|
||||
using xContentService.Models.Dtos;
|
||||
using xContentService.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xIdentityService.Interfaces;
|
||||
using xPushService.Base;
|
||||
|
||||
namespace xContentService.Providers.Dtos
|
||||
{
|
||||
public class XContentServiceProvider : XBaseDtoProvider<XContent, XContentDto, Guid, XContentDtoHub>, IXContentServiceProvider
|
||||
{
|
||||
public XContentServiceProvider(
|
||||
IHubContext<XContentDtoHub> hub,
|
||||
XDataServiceConfiguration dataConfiguration,
|
||||
IXContentRepositoryService service,
|
||||
IXIdentityProvider identityProvider = null
|
||||
) : base(
|
||||
hub,
|
||||
dataConfiguration,
|
||||
service,
|
||||
identityProvider
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using xContentService.Interfaces.Enrichers;
|
||||
|
||||
namespace xContentService.Providers.Enrichers
|
||||
{
|
||||
public class XContentEnricher : IXContentEnricher
|
||||
{
|
||||
//
|
||||
// TODO: Complete this ...
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using xContentService.Interfaces.Entities;
|
||||
using xContentService.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.Db;
|
||||
using xDataService.Interfaces;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xContentService.Providers.Entities
|
||||
{
|
||||
public class XContentEFRepository<TContext> : XBaseEFRepository<XContent, Guid, TContext>, IXContentRepository
|
||||
where TContext : XDbContext
|
||||
{
|
||||
public XContentEFRepository(
|
||||
IXUnitOfWorks<TContext> unitOfWorks,
|
||||
XDataServiceConfiguration configuration,
|
||||
IXContentKeyGenerator keyGenerator = null,
|
||||
IXContentRepositoryEvents baseRepositoryEvents = null
|
||||
) : base(
|
||||
unitOfWorks,
|
||||
configuration,
|
||||
keyGenerator,
|
||||
baseRepositoryEvents
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using xContentService.Interfaces.Entities;
|
||||
using xContentService.Models.Entities;
|
||||
using xPushService.Base;
|
||||
|
||||
namespace xContentService.Providers.Entities
|
||||
{
|
||||
public class XContentEntityHub : XBaseEntityHub<XContent, Guid>, IXContentEntityHub
|
||||
{
|
||||
public XContentEntityHub(
|
||||
ILogger<XContentEntityHub> logger
|
||||
) : base(logger)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using xContentService.Interfaces.Entities;
|
||||
using xContentService.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xContentService.Providers.Entities
|
||||
{
|
||||
public class XContentInMemoryRepository : XBaseInMemoryRepository<XContent, Guid>, IXContentRepository
|
||||
{
|
||||
public XContentInMemoryRepository(
|
||||
XDataServiceConfiguration configuration,
|
||||
IXContentKeyGenerator keyGenerator = null,
|
||||
IXContentRepositoryEvents baseRepositoryEvents = null
|
||||
) : base(
|
||||
configuration,
|
||||
keyGenerator,
|
||||
baseRepositoryEvents
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using xContentService.Interfaces.Entities;
|
||||
using xContentService.Models.Entities;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xContentService.Providers.Entities
|
||||
{
|
||||
public class XContentKeyGenerator : XGuidKeyGenerator<XContent>, IXContentKeyGenerator
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using xContentService.Interfaces.Entities;
|
||||
using xContentService.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xContentService.Providers.Entities
|
||||
{
|
||||
public class XContentMongoRepository : XBaseMongoRepository<XContent, Guid>, IXContentRepository
|
||||
{
|
||||
public XContentMongoRepository(
|
||||
XDataBaseConfiguration dbConfiguration,
|
||||
XDataServiceConfiguration configuration,
|
||||
string collectionName = null,
|
||||
IXContentKeyGenerator keyGenerator = null,
|
||||
IXContentRepositoryEvents baseRepositoryEvents = null
|
||||
) : base(
|
||||
dbConfiguration,
|
||||
configuration,
|
||||
collectionName,
|
||||
keyGenerator,
|
||||
baseRepositoryEvents
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using xContentService.Interfaces.Entities;
|
||||
using xContentService.Models.Entities;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xContentService.Providers.Entities
|
||||
{
|
||||
public class XContentRepositoryEvents : XBaseRepositoryEvents<XContent>, IXContentRepositoryEvents
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using xContentService.Interfaces.Entities;
|
||||
using xContentService.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xIdentityService.Interfaces;
|
||||
using xPushService.Base;
|
||||
|
||||
namespace xContentService.Providers.Entities
|
||||
{
|
||||
public class XContentRepositoryProvider : XBaseEntityProvider<XContent, Guid, XContentEntityHub>, IXContentRepositoryProvider
|
||||
{
|
||||
public XContentRepositoryProvider(
|
||||
IHubContext<XContentEntityHub> hub,
|
||||
IXContentRepository repository,
|
||||
XDataServiceConfiguration dataConfiguration,
|
||||
IXIdentityProvider identityProvider = null
|
||||
) : base(
|
||||
hub,
|
||||
repository,
|
||||
dataConfiguration,
|
||||
identityProvider
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using xContentService.Interfaces.Entities;
|
||||
using xContentService.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xContentService.Providers.Entities
|
||||
{
|
||||
public abstract class XContentSeederBase : XBaseDbSeeder<XContent, Guid>, IXContentSeeder
|
||||
{
|
||||
protected XContentSeederBase(
|
||||
string entity,
|
||||
string database,
|
||||
IXContentRepository repository,
|
||||
XDataServiceConfiguration dataServiceConfiguration
|
||||
) : base(
|
||||
entity,
|
||||
database,
|
||||
repository,
|
||||
dataServiceConfiguration
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using xContentService.Constants;
|
||||
using xContentService.Interfaces.Entities;
|
||||
using xContentService.Models.Entities;
|
||||
using xDataService.GraphQL;
|
||||
|
||||
namespace xContentService.Providers.GraphQL
|
||||
{
|
||||
public class XContentGraphQLTypeHelper : XBaseGraphQLTypeHelper<XContent, Guid>, IXContentGraphQLTypeHelper
|
||||
{
|
||||
public override string GetInQueryCollectionName()
|
||||
{
|
||||
return XContentServiceConstants.XContentCollectionName;
|
||||
}
|
||||
|
||||
public override string GetInQuerySingleName()
|
||||
{
|
||||
return XContentServiceConstants.XContentSingleName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using GraphQL.Types;
|
||||
using xContentService.Interfaces.Entities;
|
||||
using xContentService.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.GraphQL;
|
||||
|
||||
namespace xContentService.Providers.GraphQL
|
||||
{
|
||||
public class XContentGraphQuery : XBaseGraphQLQuery<XContent, Guid, XContentGraphType, GuidGraphType>
|
||||
{
|
||||
public XContentGraphQuery(
|
||||
XDataServiceConfiguration configuration,
|
||||
IXContentRepository repository,
|
||||
IXContentGraphQLTypeHelper helper
|
||||
) : base(
|
||||
configuration,
|
||||
repository,
|
||||
helper
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using GraphQL.Types;
|
||||
|
||||
namespace xContentService.Providers.GraphQL
|
||||
{
|
||||
public class XContentGraphSchema : Schema
|
||||
{
|
||||
public XContentGraphSchema(IServiceProvider services) : base(services)
|
||||
{
|
||||
Query = (XContentGraphQuery)services.GetService(typeof(XContentGraphQuery));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using xContentService.Models.Entities;
|
||||
using xDataService.GraphQL;
|
||||
|
||||
namespace xContentService.Providers.GraphQL
|
||||
{
|
||||
public class XContentGraphType : XBaseGraphObjectType<XContent, Guid>
|
||||
{
|
||||
public XContentGraphType() : base()
|
||||
{
|
||||
Field(x => x.Title);
|
||||
Field(x => x.OwnerId);
|
||||
Field(x => x.CreatedOn);
|
||||
Field(x => x.UpdatedAt);
|
||||
Field(x => x.Description);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using xContentService.Configuration.Entities;
|
||||
using xContentService.Models.Entities;
|
||||
using xDataService.Interfaces;
|
||||
using xDataService.Providers;
|
||||
|
||||
namespace xContentService.Providers
|
||||
{
|
||||
public class XContentEntityRegisterar : XBaseEntityRegisterar, IXEntityRegisterar
|
||||
{
|
||||
public XContentEntityRegisterar()
|
||||
: base(nameof(XContentEntityRegisterar))
|
||||
{
|
||||
//
|
||||
// Add Entity ...
|
||||
AddEntity<XContent, Guid>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configure Entities ...
|
||||
/// </summary>
|
||||
/// <param name="modelBuilder"></param>
|
||||
public override void ConfigureEntities(ModelBuilder modelBuilder)
|
||||
{
|
||||
//
|
||||
// Configure Entity Using Provided ...
|
||||
modelBuilder
|
||||
.ApplyConfigurationsFromAssembly(typeof(XContentEntityConfiguration).Assembly);
|
||||
|
||||
//
|
||||
base.ConfigureEntities(modelBuilder);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user