last ...
This commit is contained in:
@@ -0,0 +1,12 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||||
|
using xServices.Models.Entities;
|
||||||
|
|
||||||
|
namespace xServices.Configurations
|
||||||
|
{
|
||||||
|
public class XTestConfiguration : IEntityTypeConfiguration<XTest>
|
||||||
|
{
|
||||||
|
public void Configure(EntityTypeBuilder<XTest> builder)
|
||||||
|
{ }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,11 @@
|
|||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using GraphQL.Types;
|
||||||
using xDataService.Interfaces;
|
using xDataService.Interfaces;
|
||||||
using xDataService.Models;
|
using xDataService.Models;
|
||||||
|
using xServices.Interfaces;
|
||||||
|
using xServices.Models.Entities;
|
||||||
|
using xServices.Providers;
|
||||||
|
|
||||||
namespace xServices.Databases
|
namespace xServices.Databases
|
||||||
{
|
{
|
||||||
@@ -12,14 +17,12 @@ namespace xServices.Databases
|
|||||||
{
|
{
|
||||||
//
|
//
|
||||||
// XTest Entity ...
|
// XTest Entity ...
|
||||||
// new XRepositoryDescriptor
|
new XEFRepositoryDescriptor<XTest, Guid, IXTestKeyGenerator, XTestKeyGenerator, IXTestRepositoryEvents, XTestRepositoryEvents, XTestGraphType, GuidGraphType, IXTestGraphQuery, XTestGraphQuery, IXTestGraphQLTypeHelper, XTestGraphQLTypeHelper, XTestGraphSchema, IXTestRepository, XTestEFRepository, XApiDbContext>
|
||||||
// {
|
{}
|
||||||
// //
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Context = XApiDbContext;
|
OptionsBuilder = b => b.MigrationsAssembly("xApi");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using xDataService.Configuration;
|
using xDataService.Configuration;
|
||||||
using xDataService.Db;
|
using xDataService.Db;
|
||||||
|
using xServices.Models.Entities;
|
||||||
|
|
||||||
namespace xServices.Databases
|
namespace xServices.Databases
|
||||||
{
|
{
|
||||||
@@ -8,6 +9,7 @@ namespace xServices.Databases
|
|||||||
{
|
{
|
||||||
//
|
//
|
||||||
#region DbSets ...
|
#region DbSets ...
|
||||||
|
public DbSet<XTest> Tests { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
using System;
|
||||||
|
using xDataService.Interfaces;
|
||||||
|
using xServices.Models.Entities;
|
||||||
|
|
||||||
|
namespace xServices.Interfaces
|
||||||
|
{
|
||||||
|
public interface IXTestGraphQLTypeHelper : IXBaseGraphQLTypeHelper<XTest, Guid>
|
||||||
|
{ }
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
using System;
|
||||||
|
using GraphQL.Types;
|
||||||
|
using xDataService.Interfaces;
|
||||||
|
using xServices.Models.Entities;
|
||||||
|
using xServices.Providers;
|
||||||
|
|
||||||
|
namespace xServices.Interfaces
|
||||||
|
{
|
||||||
|
public interface IXTestGraphQuery : IXBaseGraphQLQuery<XTest, Guid, XTestGraphType, GuidGraphType>
|
||||||
|
{}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
using System;
|
||||||
|
using xDataService.Interfaces;
|
||||||
|
using xServices.Models.Entities;
|
||||||
|
|
||||||
|
namespace xServices.Interfaces
|
||||||
|
{
|
||||||
|
public interface IXTestKeyGenerator : IXKeyGenerator<XTest, Guid>
|
||||||
|
{ }
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
using System;
|
||||||
|
using xDataService.Interfaces;
|
||||||
|
using xServices.Models.Entities;
|
||||||
|
|
||||||
|
namespace xServices.Interfaces
|
||||||
|
{
|
||||||
|
public interface IXTestRepository : IXBaseRepository<XTest, Guid>
|
||||||
|
{ }
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
using xDataService.Interfaces;
|
||||||
|
using xServices.Models.Entities;
|
||||||
|
|
||||||
|
namespace xServices.Interfaces
|
||||||
|
{
|
||||||
|
public interface IXTestRepositoryEvents : IXBaseRepositoryEvents<XTest>
|
||||||
|
{ }
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
using System;
|
||||||
|
using xModels.Base;
|
||||||
|
|
||||||
|
namespace xServices.Models.Dtos
|
||||||
|
{
|
||||||
|
public class XTestDto :XBaseEntityDto<Guid>
|
||||||
|
{
|
||||||
|
public string Firstname { get; set; }
|
||||||
|
public string Lastname { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
using System;
|
||||||
|
using xModels.Base;
|
||||||
|
|
||||||
|
namespace xServices.Models.Entities
|
||||||
|
{
|
||||||
|
public class XTest : XBaseEntity<Guid>
|
||||||
|
{
|
||||||
|
public string Firstname { get; set; }
|
||||||
|
public string Lastname { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
using System;
|
||||||
|
using xDataService.Configuration;
|
||||||
|
using xDataService.EFRepositories;
|
||||||
|
using xDataService.Interfaces;
|
||||||
|
using xServices.Databases;
|
||||||
|
using xServices.Interfaces;
|
||||||
|
using xServices.Models.Entities;
|
||||||
|
|
||||||
|
namespace xServices.Providers
|
||||||
|
{
|
||||||
|
public class XTestEFRepository : XBaseEFRepository<XTest, Guid, XApiDbContext>, IXTestRepository
|
||||||
|
{
|
||||||
|
public XTestEFRepository(
|
||||||
|
IXUnitOfWorks<XApiDbContext> unitOfWorks,
|
||||||
|
XDataServiceConfiguration configuration,
|
||||||
|
IXTestKeyGenerator keyGenerator = null,
|
||||||
|
IXTestRepositoryEvents baseRepositoryEvents = null
|
||||||
|
) : base(
|
||||||
|
unitOfWorks,
|
||||||
|
configuration,
|
||||||
|
keyGenerator,
|
||||||
|
baseRepositoryEvents
|
||||||
|
)
|
||||||
|
{ }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
using System;
|
||||||
|
using xDataService.GraphQL;
|
||||||
|
using xServices.Interfaces;
|
||||||
|
using xServices.Models.Entities;
|
||||||
|
|
||||||
|
namespace xServices.Providers
|
||||||
|
{
|
||||||
|
public class XTestGraphQLTypeHelper : XBaseGraphQLTypeHelper<XTest, Guid>, IXTestGraphQLTypeHelper
|
||||||
|
{
|
||||||
|
public override string GetInQueryCollectionName()
|
||||||
|
{
|
||||||
|
return "tests";
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string GetInQuerySingleName()
|
||||||
|
{
|
||||||
|
return "test";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
using System;
|
||||||
|
using GraphQL.Types;
|
||||||
|
using xDataService.Configuration;
|
||||||
|
using xDataService.GraphQL;
|
||||||
|
using xServices.Interfaces;
|
||||||
|
using xServices.Models.Entities;
|
||||||
|
|
||||||
|
namespace xServices.Providers
|
||||||
|
{
|
||||||
|
public class XTestGraphQuery : XBaseGraphQLQuery<XTest, Guid, XTestGraphType, GuidGraphType>, IXTestGraphQuery
|
||||||
|
{
|
||||||
|
public XTestGraphQuery(
|
||||||
|
XDataServiceConfiguration configuration,
|
||||||
|
IXTestRepository repository,
|
||||||
|
IXTestGraphQLTypeHelper helper
|
||||||
|
) : base(
|
||||||
|
configuration,
|
||||||
|
repository,
|
||||||
|
helper
|
||||||
|
)
|
||||||
|
{ }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using GraphQL.Types;
|
||||||
|
|
||||||
|
namespace xServices.Providers
|
||||||
|
{
|
||||||
|
public class XTestGraphSchema : Schema
|
||||||
|
{
|
||||||
|
public XTestGraphSchema(IServiceProvider services) : base(services)
|
||||||
|
{
|
||||||
|
Query = (XTestGraphQuery)services.GetService(typeof(XTestGraphQuery));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
using System;
|
||||||
|
using xDataService.GraphQL;
|
||||||
|
using xServices.Models.Entities;
|
||||||
|
|
||||||
|
namespace xServices.Providers
|
||||||
|
{
|
||||||
|
public class XTestGraphType : XBaseGraphObjectType<XTest, Guid>
|
||||||
|
{
|
||||||
|
public XTestGraphType() : base()
|
||||||
|
{
|
||||||
|
Field(x => x.Firstname);
|
||||||
|
Field(x => x.Lastname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
using xDataService.Providers;
|
||||||
|
using xServices.Interfaces;
|
||||||
|
using xServices.Models.Entities;
|
||||||
|
|
||||||
|
namespace xServices.Providers
|
||||||
|
{
|
||||||
|
public class XTestKeyGenerator : XGuidKeyGenerator<XTest>, IXTestKeyGenerator
|
||||||
|
{ }
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
using xDataService.Events;
|
||||||
|
using xServices.Interfaces;
|
||||||
|
using xServices.Models.Entities;
|
||||||
|
|
||||||
|
namespace xServices.Providers
|
||||||
|
{
|
||||||
|
public class XTestRepositoryEvents : XBaseRepositoryEvents<XTest>, IXTestRepositoryEvents
|
||||||
|
{ }
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user