Initial Commit ...
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
namespace xDataService.Models {
|
||||
/// <summary>
|
||||
/// Pass Data on Repository Events ...
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public class XBaseEventModel<T> {
|
||||
public T Model { get; set; }
|
||||
|
||||
public XBaseEventModel (T model) {
|
||||
Model = model;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using GraphQL.Types;
|
||||
using xModels.Dtos;
|
||||
|
||||
namespace xDataService.Models {
|
||||
public class XGraphQueryResult<TEntity, TGraph> : ObjectGraphType<XQueryResult<TEntity>>
|
||||
where TGraph : IGraphType {
|
||||
public XGraphQueryResult () {
|
||||
//
|
||||
Name = $"{typeof(TGraph).Name}QueryResult";
|
||||
|
||||
//
|
||||
Field<ListGraphType<TGraph>> (nameof (XQueryResult<TEntity>.Items));
|
||||
Field (x => x.Page);
|
||||
Field (x => x.PageSize);
|
||||
Field (x => x.TotalPages);
|
||||
Field (x => x.TotalFilteredItems);
|
||||
Field (x => x.TotalItems);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using GraphQL.Types;
|
||||
using xModels.Dtos;
|
||||
|
||||
namespace xDataService.Models {
|
||||
public class XGraphQueryType : InputObjectGraphType<XQuery> {
|
||||
public XGraphQueryType () {
|
||||
//
|
||||
Name = "query";
|
||||
|
||||
//
|
||||
Field (x => x.Filter);
|
||||
Field (x => x.ContainsDetail);
|
||||
Field (x => x.SortBy);
|
||||
Field (x => x.IsAscending);
|
||||
Field (x => x.Page);
|
||||
Field (x => x.PageSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user