Initial Commit ...
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using xCommons.Constants;
|
||||
using xModels.Base;
|
||||
|
||||
namespace xModels.Dtos {
|
||||
public class XDeviceDto : XBaseDto {
|
||||
/// <summary>
|
||||
/// Operating System
|
||||
/// </summary>
|
||||
/// <value>device operating system identifier</value>
|
||||
public string Os { get; set; }
|
||||
/// <summary>
|
||||
/// Operating System Version
|
||||
/// </summary>
|
||||
/// <value>which version of operatin system is in use</value>
|
||||
public string OsVersion { get; set; }
|
||||
/// <summary>
|
||||
/// Device Browser
|
||||
/// </summary>
|
||||
/// <value>the Browser identifier</value>
|
||||
public string Browser { get; set; }
|
||||
/// <summary>
|
||||
/// Browser Engine Agent
|
||||
/// </summary>
|
||||
/// <value>browser engine Agent</value>
|
||||
public string UserAgent { get; set; }
|
||||
/// <summary>
|
||||
/// Type of client Device
|
||||
/// </summary>
|
||||
/// <value>represent device type <see>XDeviceType</see></value>
|
||||
public XDeviceType DeviceType { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using xCommons.Constants;
|
||||
using xModels.Base;
|
||||
|
||||
namespace xModels.Dtos {
|
||||
public partial class XFileDto : XBaseDto {
|
||||
[Required]
|
||||
public string AuthorId { get; set; }
|
||||
|
||||
public XFileType Type { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength (255)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[StringLength (255)]
|
||||
public string Thumb { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength (255)]
|
||||
public string Path { get; set; }
|
||||
|
||||
[StringLength (255)]
|
||||
public string ThumbPath { get; set; }
|
||||
|
||||
[Required]
|
||||
public DateTime UploadedOn { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
namespace xModels.Dtos {
|
||||
/// <summary>
|
||||
/// Some Requests Get Object Response Result of Data ...
|
||||
/// </summary>
|
||||
public struct XObjectResponseResult<T> {
|
||||
|
||||
public XObjectResponseResult (T responseObject, string responseText) {
|
||||
this.Object = responseObject;
|
||||
this.Text = responseText;
|
||||
}
|
||||
|
||||
public T Object { get; }
|
||||
|
||||
public string Text { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
namespace xModels.Dtos {
|
||||
/// <summary>
|
||||
/// Request a Page of Data based on Cursor ...
|
||||
/// this only be Used in GraphQL ...
|
||||
/// </summary>
|
||||
public class XPageRequest {
|
||||
public int? First { get; set; }
|
||||
public int? Last { get; set; }
|
||||
public string After { get; set; } = "";
|
||||
public string Before { get; set; } = "";
|
||||
public string SortBy { get; set; } = "";
|
||||
public bool DescendingSort { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace xModels.Dtos {
|
||||
/// <summary>
|
||||
/// Result of a Requested Page of Data based on Cursor ...
|
||||
/// this only be Used in GraphQL ...
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public class XPageResponse<T> {
|
||||
public List<T> Nodes { get; set; }
|
||||
public int TotalCount { get; set; }
|
||||
public bool HasNextPage { get; set; }
|
||||
public bool HasPreviousPage { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using xModels.Base;
|
||||
|
||||
namespace xModels.Dtos {
|
||||
/// <summary>
|
||||
/// Request a Page of Data Based on Query ...
|
||||
/// this can used in every Data Providers ...
|
||||
/// </summary>
|
||||
public class XQuery : XBaseDto {
|
||||
/// <summary>
|
||||
/// an string for filtering results
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public string Filter { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// determines fully load object with it's relational fields or not
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public bool ContainsDetail { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// specifiy sorting of items
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string SortBy { get; set; } = nameof (XBaseIntIDEntity.Id);
|
||||
|
||||
/// <summary>
|
||||
/// specify sorting direction
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public bool IsAscending { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// specify page number
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public int Page { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// specify page size
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public int PageSize { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using System.Collections.Generic;
|
||||
using xModels.Base;
|
||||
|
||||
namespace xModels.Dtos {
|
||||
/// <summary>
|
||||
/// Result of a Requested Page of Data Based on Query ...
|
||||
/// this can used in every Data Providers ...
|
||||
/// </summary>
|
||||
public class XQueryResult<T> : XBaseDto {
|
||||
/// <summary>
|
||||
/// a collection of items for a page ...
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public IEnumerable<T> Items { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Current Page Number ...
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public long Page { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Current Page Size ...
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public long PageSize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Total Pages ...
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public long TotalPages { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Total Filtered Items ...
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public long TotalFilteredItems { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Total Exists Items ...
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public long TotalItems { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace xModels.Dtos {
|
||||
/// <summary>
|
||||
/// in some cases we have to validate a revision of request, this is a model
|
||||
/// which used to request a revision validator ...
|
||||
/// </summary>
|
||||
public class XValidateRevisionRequest {
|
||||
[Required]
|
||||
public string Revision { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user