Skip to content

Commit

Permalink
Type entities and revisions to paging
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuck committed Dec 29, 2020
1 parent 7a4de67 commit a76968a
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/YuckQi.Domain.Services/Abstract/ITypeEntityService.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Threading.Tasks;
using YuckQi.Domain.Application.Queries.Results;
using YuckQi.Domain.Entities.Types;
using YuckQi.Domain.Entities.Types.Abstract;
using YuckQi.Domain.Services.Models;
using YuckQi.Domain.Validation;
using YuckQi.Domain.ValueObjects;

namespace YuckQi.Domain.Services.Abstract
{
Expand Down
2 changes: 1 addition & 1 deletion src/YuckQi.Domain.Services/Models/TypeSearchCriteria.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using YuckQi.Domain.Application.Abstract;
using YuckQi.Domain.ValueObjects.Abstract;

namespace YuckQi.Domain.Services.Models
{
Expand Down
2 changes: 1 addition & 1 deletion src/YuckQi.Domain.Services/YuckQi.Domain.Services.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>Kevin J Lambert</Authors>
<Version>0.3.1</Version>
<Version>0.4.0</Version>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>Kevin J Lambert</Authors>
<Version>0.3.1</Version>
<Version>0.4.0</Version>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
</PropertyGroup>

Expand Down
11 changes: 11 additions & 0 deletions src/YuckQi.Domain/Entities/Types/Abstract/ITypeEntity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System;
using YuckQi.Domain.Entities.Abstract;

namespace YuckQi.Domain.Entities.Types.Abstract
{
public interface ITypeEntity<TKey> : IEntity<TKey> where TKey : struct
{
Guid Identifier { get; set; }
string Name { get; set; }
}
}
12 changes: 12 additions & 0 deletions src/YuckQi.Domain/Entities/Types/Abstract/TypeEntityBase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using YuckQi.Domain.Entities.Abstract;

namespace YuckQi.Domain.Entities.Types.Abstract
{
public abstract class TypeEntityBase<TKey> : EntityBase<TKey>, ITypeEntity<TKey> where TKey : struct
{
public Guid Identifier { get; set; }
public string Name { get; set; }
public string ShortName { get; set; }
}
}
10 changes: 0 additions & 10 deletions src/YuckQi.Domain/Entities/Types/TypeEntityBase.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace YuckQi.Domain.Application.Abstract
namespace YuckQi.Domain.ValueObjects.Abstract
{
public interface IPage
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System.Collections.Generic;
using YuckQi.Domain.Application.Abstract;
using YuckQi.Domain.ValueObjects.Abstract;

namespace YuckQi.Domain.Application.Queries.Results
namespace YuckQi.Domain.ValueObjects
{
public class Page : IPage
public readonly struct Page : IPage
{
#region Properties

Expand All @@ -15,30 +15,34 @@ public class Page : IPage

#region Constructors

public Page(int number, int size)
public Page(int page, int size)
{
PageNumber = number;
PageNumber = page;
PageSize = size;
}

#endregion
}

public class Page<T> : Page where T : class
public readonly struct Page<T> : IPage where T : class
{
#region Properties

public IReadOnlyCollection<T> Items { get; }
public int PageNumber { get; }
public int PageSize { get; }
public int TotalCount { get; }

#endregion


#region Constructors

public Page(IReadOnlyCollection<T> items, int total, int number, int size) : base(number, size)
public Page(IReadOnlyCollection<T> items, int total, int page, int size)
{
Items = items ?? new List<T>();
PageNumber = page;
PageSize = size;
TotalCount = total;
}

Expand Down
2 changes: 1 addition & 1 deletion src/YuckQi.Domain/YuckQi.Domain.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>Kevin J Lambert</Authors>
<Version>0.3.1</Version>
<Version>0.4.0</Version>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
</PropertyGroup>

Expand Down

0 comments on commit a76968a

Please sign in to comment.