last ...
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using xFileService.Interfaces.Dtos;
|
||||
using xFileService.Models.Dtos;
|
||||
using xFileService.Models.Entities;
|
||||
using xPushService.Base;
|
||||
|
||||
namespace xFileService.Providers.Dtos
|
||||
{
|
||||
public class XFileDtoHub : XBaseDtoHub<XFile, XFileDto, Guid>, IXFileDtoHub
|
||||
{
|
||||
public XFileDtoHub(
|
||||
ILogger<XFileDtoHub> logger
|
||||
) : base(logger)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using AutoMapper;
|
||||
using xDataService.Providers;
|
||||
using xFileService.Interfaces.Dtos;
|
||||
using xFileService.Interfaces.Entities;
|
||||
using xFileService.Models.Dtos;
|
||||
using xFileService.Models.Entities;
|
||||
|
||||
namespace xFileService.Providers.Dtos
|
||||
{
|
||||
public class XFileRepositoryService : XBaseRepositoryService<XFile, XFileDto, Guid>, IXFileRepositoryService
|
||||
{
|
||||
public XFileRepositoryService(
|
||||
IXFileRepository repository,
|
||||
IEnumerable<Profile> mapperProfiles = null
|
||||
) : base(
|
||||
repository,
|
||||
mapperProfiles
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using xDataService.Configuration;
|
||||
using xFileService.Interfaces.Dtos;
|
||||
using xFileService.Models.Dtos;
|
||||
using xFileService.Models.Entities;
|
||||
using xIdentityService.Interfaces;
|
||||
using xPushService.Base;
|
||||
|
||||
namespace xFileService.Providers.Dtos
|
||||
{
|
||||
public class XFileServiceProvider : XBaseDtoProvider<XFile, XFileDto, Guid, XFileDtoHub>, IXFileServiceProvider
|
||||
{
|
||||
public XFileServiceProvider(
|
||||
IHubContext<XFileDtoHub> hub,
|
||||
XDataServiceConfiguration dataConfiguration,
|
||||
IXFileRepositoryService service,
|
||||
IXIdentityProvider identityProvider = null
|
||||
) : base(
|
||||
hub,
|
||||
dataConfiguration,
|
||||
service,
|
||||
identityProvider
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.Db;
|
||||
using xDataService.Interfaces;
|
||||
using xDataService.Providers;
|
||||
using xFileService.Interfaces.Entities;
|
||||
using xFileService.Models.Entities;
|
||||
|
||||
namespace xFileService.Providers.Entities
|
||||
{
|
||||
public class XFileEFRepository<TContext> : XBaseEFRepository<XFile, Guid, TContext>, IXFileRepository
|
||||
where TContext : XDbContext
|
||||
{
|
||||
public XFileEFRepository(
|
||||
IXUnitOfWorks<TContext> unitOfWorks,
|
||||
XDataServiceConfiguration configuration,
|
||||
IXFileKeyGenerator keyGenerator = null,
|
||||
IXFileRepositoryEvents baseRepositoryEvents = null
|
||||
) : base(
|
||||
unitOfWorks,
|
||||
configuration,
|
||||
keyGenerator,
|
||||
baseRepositoryEvents
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using xFileService.Interfaces.Entities;
|
||||
using xFileService.Models.Entities;
|
||||
using xPushService.Base;
|
||||
|
||||
namespace xFileService.Providers.Entities
|
||||
{
|
||||
public class XFileEntityHub : XBaseEntityHub<XFile, Guid>, IXFileEntityHub
|
||||
{
|
||||
public XFileEntityHub(
|
||||
ILogger<XFileEntityHub> logger
|
||||
) : base(logger)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.Providers;
|
||||
using xFileService.Interfaces.Entities;
|
||||
using xFileService.Models.Entities;
|
||||
|
||||
namespace xFileService.Providers.Entities
|
||||
{
|
||||
public class XFileInMemoryRepository : XBaseInMemoryRepository<XFile, Guid>, IXFileRepository
|
||||
{
|
||||
public XFileInMemoryRepository(
|
||||
XDataServiceConfiguration configuration,
|
||||
IXFileKeyGenerator keyGenerator = null,
|
||||
IXFileRepositoryEvents baseRepositoryEvents = null
|
||||
) : base(
|
||||
configuration,
|
||||
keyGenerator,
|
||||
baseRepositoryEvents
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using xDataService.Providers;
|
||||
using xFileService.Interfaces.Entities;
|
||||
using xFileService.Models.Entities;
|
||||
|
||||
namespace xFileService.Providers.Entities
|
||||
{
|
||||
public class XFileKeyGenerator : XGuidKeyGenerator<XFile>, IXFileKeyGenerator
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.Providers;
|
||||
using xFileService.Interfaces.Entities;
|
||||
using xFileService.Models.Entities;
|
||||
|
||||
namespace xFileService.Providers.Entities
|
||||
{
|
||||
public class XFileMongoRepository : XBaseMongoRepository<XFile, Guid>, IXFileRepository
|
||||
{
|
||||
public XFileMongoRepository(
|
||||
XDataBaseConfiguration dbConfiguration,
|
||||
XDataServiceConfiguration configuration,
|
||||
string collectionName = null,
|
||||
IXFileKeyGenerator keyGenerator = null,
|
||||
IXFileRepositoryEvents baseRepositoryEvents = null
|
||||
) : base(
|
||||
dbConfiguration,
|
||||
configuration,
|
||||
collectionName,
|
||||
keyGenerator,
|
||||
baseRepositoryEvents
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using xDataService.Providers;
|
||||
using xFileService.Interfaces.Entities;
|
||||
using xFileService.Models.Entities;
|
||||
|
||||
namespace xFileService.Providers.Entities
|
||||
{
|
||||
public class XFileRepositoryEvents : XBaseRepositoryEvents<XFile>, IXFileRepositoryEvents
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using xDataService.Configuration;
|
||||
using xFileService.Interfaces.Entities;
|
||||
using xFileService.Models.Entities;
|
||||
using xIdentityService.Interfaces;
|
||||
using xPushService.Base;
|
||||
|
||||
namespace xFileService.Providers.Entities
|
||||
{
|
||||
public class XFileRepositoryProvider : XBaseEntityProvider<XFile, Guid, XFileEntityHub>, IXFileRepositoryProvider
|
||||
{
|
||||
public XFileRepositoryProvider(
|
||||
IHubContext<XFileEntityHub> hub,
|
||||
IXFileRepository repository,
|
||||
XDataServiceConfiguration dataConfiguration,
|
||||
IXIdentityProvider identityProvider = null
|
||||
) : base(
|
||||
hub,
|
||||
repository,
|
||||
dataConfiguration,
|
||||
identityProvider
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.GraphQL;
|
||||
using xFileService.Interfaces.Entities;
|
||||
using xFileService.Models.Entities;
|
||||
|
||||
namespace xFileService.Providers.GraphQL
|
||||
{
|
||||
public class XFileGraphQLTypeHelper : XBaseGraphQLTypeHelper<XFile, Guid>, IXFileGraphQLTypeHelper
|
||||
{
|
||||
public XFileGraphQLTypeHelper(
|
||||
XDataServiceConfiguration configuration
|
||||
) : base(configuration)
|
||||
{ }
|
||||
|
||||
public override string GetInQueryCollectionName()
|
||||
{
|
||||
return "files";
|
||||
}
|
||||
|
||||
public override string GetInQuerySingleName()
|
||||
{
|
||||
return "file";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using GraphQL.Types;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.GraphQL;
|
||||
using xFileService.Interfaces.Entities;
|
||||
using xFileService.Models.Entities;
|
||||
|
||||
namespace xFileService.Providers.GraphQL
|
||||
{
|
||||
public class XFileGraphQuery : XBaseGraphQLQuery<XFile, Guid, XFileGraphType, GuidGraphType>
|
||||
{
|
||||
public XFileGraphQuery(
|
||||
XDataServiceConfiguration configuration,
|
||||
IXFileRepository repository,
|
||||
IXFileGraphQLTypeHelper helper
|
||||
) : base(
|
||||
configuration,
|
||||
repository,
|
||||
helper
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using GraphQL.Types;
|
||||
|
||||
namespace xFileService.Providers.GraphQL
|
||||
{
|
||||
public class XFileGraphSchema : Schema
|
||||
{
|
||||
public XFileGraphSchema(IServiceProvider services) : base(services)
|
||||
{
|
||||
Query = (XFileGraphQuery)services.GetService(typeof(XFileGraphQuery));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using xDataService.GraphQL;
|
||||
using xFileService.Models.Entities;
|
||||
|
||||
namespace xFileService.Providers.GraphQL
|
||||
{
|
||||
public class XFileGraphType : XBaseGraphObjectType<XFile, Guid>
|
||||
{
|
||||
public XFileGraphType() : base()
|
||||
{
|
||||
Field(x => x.Type);
|
||||
Field(x => x.Name);
|
||||
Field(x => x.Path);
|
||||
Field(x => x.Thumb);
|
||||
Field(x => x.OwnerId);
|
||||
Field(x => x.FileName);
|
||||
Field(x => x.ThumbPath);
|
||||
Field(x => x.UploadedOn);
|
||||
Field(x => x.References);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using xDataService.Interfaces;
|
||||
using xDataService.Providers;
|
||||
using xFileService.Models.Entities;
|
||||
|
||||
namespace xFileService.Providers
|
||||
{
|
||||
public class XFileEntityRegisterar : XBaseEntityRegisterar, IXEntityRegisterar
|
||||
{
|
||||
public XFileEntityRegisterar()
|
||||
: base(nameof(XFileEntityRegisterar))
|
||||
{
|
||||
//
|
||||
// Add XFile Entity ...
|
||||
AddEntity<XFile, Guid>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configure Entities ...
|
||||
/// </summary>
|
||||
/// <param name="modelBuilder"></param>
|
||||
public override void ConfigureEntities(ModelBuilder modelBuilder)
|
||||
{
|
||||
base.ConfigureEntities(modelBuilder);
|
||||
}
|
||||
}
|
||||
}
|
||||
+156
-1582
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.Providers;
|
||||
using xFileService.Interfaces;
|
||||
using xFileService.Interfaces.Entities;
|
||||
using xFileService.Models.Entities;
|
||||
|
||||
namespace xFileService.Providers
|
||||
{
|
||||
public abstract class XFileSeederBase : XBaseDbSeeder<XFile, Guid>, IXFileSeeder
|
||||
{
|
||||
protected XFileSeederBase(
|
||||
string entity,
|
||||
string database,
|
||||
IXFileRepository repository,
|
||||
XDataServiceConfiguration dataServiceConfiguration
|
||||
) : base(
|
||||
entity,
|
||||
database,
|
||||
repository,
|
||||
dataServiceConfiguration
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using xFileService.Interfaces;
|
||||
using xFileService.Models.Entities;
|
||||
using xTagService.Interfaces;
|
||||
using xTagService.Interfaces.Dtos;
|
||||
using xTagService.Providers;
|
||||
|
||||
namespace xFileService.Providers
|
||||
@@ -9,9 +9,10 @@ namespace xFileService.Providers
|
||||
public class XFileTagProvider : XBaseTagProvider<Guid>, IXFileTagProvider
|
||||
{
|
||||
public XFileTagProvider(
|
||||
IXTagProvider tagProvider
|
||||
string providedFor,
|
||||
IXTagServiceProvider tagProvider
|
||||
) : base(
|
||||
providedFor: nameof(XFile),
|
||||
providedFor: nameof(XFile),
|
||||
tagProvider: tagProvider
|
||||
)
|
||||
{ }
|
||||
|
||||
Reference in New Issue
Block a user