implement all Data Helper Requirements ...

This commit is contained in:
2025-11-04 01:49:13 +03:30
parent cad42da9e1
commit 71f695baf8
16 changed files with 116 additions and 116 deletions
@@ -1,12 +1,26 @@
using System; using System;
using System.Collections.Generic; using xDataService.Configuration;
using System.Linq; using xDataService.GraphQL;
using System.Threading.Tasks; using xWebinarService.Interfaces.Entities;
using xWebinarService.Models.Entities;
namespace xWebinarService.DataHelper.GraphQL namespace xWebinarService.DataHelper.GraphQL
{ {
public class XWebinarGraphQLTypeHelper public class XWebinarGraphQLTypeHelper : XBaseGraphQLTypeHelper<XWebinar, Guid>, IXWebinarGraphQLTypeHelper
{ {
public XWebinarGraphQLTypeHelper(
XDataServiceConfiguration configuration
) : base(configuration)
{ }
public override string GetInQueryCollectionName()
{
return "webinars";
}
public override string GetInQuerySingleName()
{
return "webinar";
}
} }
} }
+16 -5
View File
@@ -1,12 +1,23 @@
using System; using System;
using System.Collections.Generic; using GraphQL.Types;
using System.Linq; using xDataService.Configuration;
using System.Threading.Tasks; using xDataService.GraphQL;
using xWebinarService.Interfaces.Entities;
using xWebinarService.Models.Entities;
namespace xWebinarService.DataHelper.GraphQL namespace xWebinarService.DataHelper.GraphQL
{ {
public class XWebinarGraphQuery public class XWebinarGraphQuery : XBaseGraphQLQuery<XWebinar, Guid, XWebinarGraphType, GuidGraphType>
{ {
public XWebinarGraphQuery(
XDataServiceConfiguration configuration,
IXWebinarRepository repository,
IXWebinarGraphQLTypeHelper helper
) : base(
configuration,
repository,
helper
)
{ }
} }
} }
+6 -5
View File
@@ -1,12 +1,13 @@
using System; using System;
using System.Collections.Generic; using GraphQL.Types;
using System.Linq;
using System.Threading.Tasks;
namespace xWebinarService.DataHelper.GraphQL namespace xWebinarService.DataHelper.GraphQL
{ {
public class XWebinarGraphSchema public class XWebinarGraphSchema : Schema
{ {
public XWebinarGraphSchema(IServiceProvider services) : base(services)
{
Query = (XWebinarGraphQuery)services.GetService(typeof(XWebinarGraphQuery));
}
} }
} }
+10 -5
View File
@@ -1,12 +1,17 @@
using System; using System;
using System.Collections.Generic; using xDataService.GraphQL;
using System.Linq; using xWebinarService.Models.Entities;
using System.Threading.Tasks;
namespace xWebinarService.DataHelper.GraphQL namespace xWebinarService.DataHelper.GraphQL
{ {
public class XWebinarGraphType public class XWebinarGraphType : XBaseGraphObjectType<XWebinar, Guid>
{ {
public XWebinarGraphType() : base()
{
Field(x => x.Title);
Field(x => x.Description);
Field(x => x.OwnerId);
Field(x => x.CreatedOn);
}
} }
} }
@@ -2,11 +2,27 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using xDataService.Configuration;
using xDataService.GraphQL;
using xWebinarService.Interfaces.Entities;
using xWebinarService.Models.Entities;
namespace xWebinarService.DataHelper.GraphQL namespace xWebinarService.DataHelper.GraphQL
{ {
public class XWebinarSubscriberGraphQLTypeHelper public class XWebinarSubscriberGraphQLTypeHelper : XBaseGraphQLTypeHelper<XWebinarSubscriber, int>, IXWebinarSubscriberGraphQLTypeHelper
{ {
public XWebinarSubscriberGraphQLTypeHelper(
XDataServiceConfiguration configuration
) : base(configuration) { }
public override string GetInQueryCollectionName()
{
return "webinarSubscribers";
}
public override string GetInQuerySingleName()
{
return "webinarSubscriber";
}
} }
} }
@@ -1,12 +1,23 @@
using System; using GraphQL.Types;
using System.Collections.Generic; using xDataService.Configuration;
using System.Linq; using xDataService.GraphQL;
using System.Threading.Tasks; using xWebinarService.Interfaces.Entities;
using xWebinarService.Models.Entities;
namespace xWebinarService.DataHelper.GraphQL namespace xWebinarService.DataHelper.GraphQL
{ {
public class XWebinarSubscriberGraphQuery public class XWebinarSubscriberGraphQuery : XBaseGraphQLQuery<XWebinarSubscriber, int, XWebinarSubscriberGraphType, IntGraphType>
{
public XWebinarSubscriberGraphQuery(
XDataServiceConfiguration configuration,
IXWebinarSubscriberRepository repository,
IXWebinarSubscriberGraphQLTypeHelper helper
) : base(
configuration,
repository,
helper
)
{ {
}
} }
} }
@@ -1,12 +1,13 @@
using System; using System;
using System.Collections.Generic; using GraphQL.Types;
using System.Linq;
using System.Threading.Tasks;
namespace xWebinarService.DataHelper.GraphQL namespace xWebinarService.DataHelper.GraphQL
{ {
public class XWebinarSubscriberGraphSchema public class XWebinarSubscriberGraphSchema : Schema
{ {
public XWebinarSubscriberGraphSchema(IServiceProvider services) : base(services)
{
Query = (XWebinarSubscriberGraphQuery)services.GetService(typeof(XWebinarSubscriberGraphQuery));
}
} }
} }
@@ -1,12 +1,15 @@
using System; using xDataService.GraphQL;
using System.Collections.Generic; using xWebinarService.Models.Entities;
using System.Linq;
using System.Threading.Tasks;
namespace xWebinarService.DataHelper.GraphQL namespace xWebinarService.DataHelper.GraphQL
{ {
public class XWebinarSubscriberGraphType public class XWebinarSubscriberGraphType : XBaseGraphObjectType<XWebinarSubscriber, int>
{ {
public XWebinarSubscriberGraphType() : base()
{
Field(x => x.SubscriberId);
Field(x => x.WebinarId);
Field(x => x.SubscribedOn);
}
} }
} }
@@ -1,12 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace xWebinarService.DataHelper.Repository.EF
{
public class XWebinarEFRepository
{
}
}
@@ -1,12 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace xWebinarService.DataHelper.Repository.EF
{
public class XWebinarSubscriberEFRepository
{
}
}
@@ -1,12 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace xWebinarService.DataHelper.Repository.Mongo
{
public class XWebinarMongoRepository
{
}
}
@@ -1,12 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace xWebinarService.DataHelper.Repository.Mongo
{
public class XWebinarSubscriberMongoRepository
{
}
}
@@ -1,12 +1,9 @@
using System; using System;
using System.Collections.Generic; using xDataService.Interfaces;
using System.Linq; using xWebinarService.Models.Entities;
using System.Threading.Tasks;
namespace xWebinarService.Interfaces.Entities namespace xWebinarService.Interfaces.Entities
{ {
public interface IXWebinarGraphQLTypeHelper public interface IXWebinarGraphQLTypeHelper : IXBaseGraphQLTypeHelper<XWebinar, Guid>
{ { }
}
} }
+4 -7
View File
@@ -1,12 +1,9 @@
using System; using System;
using System.Collections.Generic; using xDataService.Interfaces;
using System.Linq; using xWebinarService.Models.Entities;
using System.Threading.Tasks;
namespace xWebinarService.Interfaces.Entities namespace xWebinarService.Interfaces.Entities
{ {
public interface IXWebinarRepository public interface IXWebinarRepository : IXBaseRepository<XWebinar, Guid>
{ { }
}
} }
@@ -1,12 +1,8 @@
using System; using xDataService.Interfaces;
using System.Collections.Generic; using xWebinarService.Models.Entities;
using System.Linq;
using System.Threading.Tasks;
namespace xWebinarService.Interfaces.Entities namespace xWebinarService.Interfaces.Entities
{ {
public interface IXWebinarSubscriberGraphQLTypeHelper public interface IXWebinarSubscriberGraphQLTypeHelper : IXBaseGraphQLTypeHelper<XWebinarSubscriber, int>
{ { }
}
} }
@@ -1,12 +1,8 @@
using System; using xDataService.Interfaces;
using System.Collections.Generic; using xWebinarService.Models.Entities;
using System.Linq;
using System.Threading.Tasks;
namespace xWebinarService.Interfaces.Entities namespace xWebinarService.Interfaces.Entities
{ {
public interface IXWebinarSubscriberRepository public interface IXWebinarSubscriberRepository : IXBaseRepository<XWebinarSubscriber, int>
{ { }
}
} }