mirror of
https://github.com/XFox111/PhonebookService.git
synced 2026-04-22 06:29:55 +03:00
Initial commit.
- Created and set up main projects - Created classes for Domain
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
namespace PhonebookService.Domain.Queries;
|
||||
|
||||
/// <summary>
|
||||
/// A model that represents a search/filter query for phonebook
|
||||
/// </summary>
|
||||
public class PhonebookFilterQuery
|
||||
{
|
||||
/// <summary>
|
||||
/// Number of a page to show. Starts from one.
|
||||
/// </summary>
|
||||
/// <value>Default is 1</value>
|
||||
public int Page { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// Optional property to filter records that contain the value in their <see cref="Models.PhonebookRecord.FirstName"/>
|
||||
/// </summary>
|
||||
public string? FirstName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Optional property to filter records that match the city name
|
||||
/// </summary>
|
||||
public string? City { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Optional property to filter records that match the phone number
|
||||
/// </summary>
|
||||
public string? Phone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Optional property to filter records that match the zip code
|
||||
/// </summary>
|
||||
public string? ZipCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Optional property to sort the result collection by <see cref="FirstName"/>
|
||||
/// </summary>
|
||||
/// <value>Default is 0 (None)</value>
|
||||
public SortMode Sort { get; set; } = SortMode.None;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace PhonebookService.Domain.Queries;
|
||||
|
||||
/// <summary>
|
||||
/// Sorting options for <see cref="PhonebookFilterQuery"/>
|
||||
/// </summary>
|
||||
public enum SortMode
|
||||
{
|
||||
Ascending = 1,
|
||||
None = 0,
|
||||
Descending = -1
|
||||
}
|
||||
Reference in New Issue
Block a user