Fix: Rename Generic.CL folder to flat structure, update csproj and references
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Generic.Contracts.Generics;
|
||||
|
||||
public class ComplexSortModel
|
||||
{
|
||||
public IEnumerable<SortModel> Sorts { get; set; } = new List<SortModel>();
|
||||
}
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Generic.Contracts.Generics
|
||||
{
|
||||
|
||||
public class Pagination
|
||||
{
|
||||
public int? PageSize { get; set; }
|
||||
public int? CurrentPage { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public int? ItemsCount { get; set; } = 0;
|
||||
|
||||
[JsonIgnore]
|
||||
public int? TotalPages
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ItemsCount == null || ItemsCount == 0) return 0;
|
||||
if (PageSize == null || PageSize == 0) return 1;
|
||||
return (int)Math.Ceiling((decimal)ItemsCount / (decimal)PageSize.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace Generic.Contracts.Generics;
|
||||
|
||||
public enum SortDir
|
||||
{
|
||||
Ascending,
|
||||
Descending,
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Generic.Contracts.Generics;
|
||||
|
||||
public class SortModel
|
||||
{
|
||||
public string SortBy { get; set; }
|
||||
|
||||
public SortDir SortDirection { get; set; } = SortDir.Ascending;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user