Skip to content

Commit b852c02

Browse files
committed
Baseline for Demo
1 parent 254a225 commit b852c02

35 files changed

+391
-39
lines changed

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,9 @@ ServiceFabricBackup/
262262
*.rptproj.bak
263263

264264
# SQL Server files
265-
*.mdf
266-
*.ldf
267-
*.ndf
265+
#*.mdf
266+
#*.ldf
267+
#*.ndf
268268

269269
# Business Intelligence projects
270270
*.rdl.data

Demos/LicenseTrack/AppCode/.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,9 @@ ServiceFabricBackup/
262262
*.rptproj.bak
263263

264264
# SQL Server files
265-
*.mdf
266-
*.ldf
267-
*.ndf
265+
#*.mdf
266+
#*.ldf
267+
#*.ndf
268268

269269
# Business Intelligence projects
270270
*.rdl.data
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Demo.LicenseTrack.App.Model
6+
{
7+
/// <summary>
8+
/// Message information to be displayed in a dialog.
9+
/// </summary>
10+
public class DialogMessage
11+
{
12+
public string Message { get; set; }
13+
public string Title { get; set; }
14+
}
15+
}

Demos/LicenseTrack/AppCode/Demo.LicenseTrack.App.Model/LibraryLoader.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@ protected override void LoadManualRegistration(IServiceCollection serviceCollect
3434
}
3535

3636

37+
38+
3739
/// <summary>
38-
/// Loads transient service registrations with the hosting DI container.
40+
/// Automated registration of classes using transient registration.
3941
/// </summary>
40-
/// <param name="serviceCollection">The dependency injection provider to register services with.</param>
41-
/// <param name="configuration">The source configuration to provide for dependency injection.</param>
42+
/// <param name="serviceCollection">The service collection to register services.</param>
43+
/// <param name="configuration">The configuration data used with register of services.</param>
4244
protected override void LoadRegistration(IServiceCollection serviceCollection, IConfiguration configuration)
4345
{
4446
//Intentionally blank
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Demo.LicenseTrack.App.Model
6+
{
7+
/// <summary>
8+
/// Data class that provides the results from a <see cref="PageDataRequest"/>.
9+
/// </summary>
10+
/// <typeparam name="T">The target type of the data model to be returned.</typeparam>
11+
public class PageDataResponse<T> where T : class
12+
{
13+
/// <summary>
14+
/// The total number of records in the full query results.
15+
/// </summary>
16+
public int TotalCount { get; set; }
17+
18+
/// <summary>
19+
/// The data results from the paging request.
20+
/// </summary>
21+
public List<T> Results { get; set; } = new List<T>();
22+
}
23+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Demo.LicenseTrack.App.Model
6+
{
7+
/// <summary>
8+
/// Data class that captures information needed for a set size page of data.
9+
/// </summary>
10+
public class PageDataRequest
11+
{
12+
/// <summary>
13+
/// The page number to return.
14+
/// </summary>
15+
public int Page { get; set; }
16+
17+
/// <summary>
18+
/// The number of records for a page.
19+
/// </summary>
20+
public int PageSize { get; set; }
21+
22+
/// <summary>
23+
/// Optional property that determines the text to be search for on all supported fields.
24+
/// </summary>
25+
public string Search { get; set; }
26+
27+
/// <summary>
28+
/// Optional property that provides a list of fields to be sorted and the sort direction.
29+
/// </summary>
30+
public List<SortingDirection> FieldsSorting { get; set; } = new List<SortingDirection>();
31+
}
32+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Demo.LicenseTrack.App.Model
6+
{
7+
/// <summary>
8+
/// Data class to provide sort direction for fields on grid.
9+
/// </summary>
10+
public class SortingDirection
11+
{
12+
/// <summary>
13+
/// Field being sorted
14+
/// </summary>
15+
public string FieldName { get; set; }
16+
17+
/// <summary>
18+
/// Is the field in descending direction
19+
/// </summary>
20+
public bool IsDesc { get; set; }
21+
}
22+
}

Demos/LicenseTrack/AppCode/Demo.LicenseTrack.Client.Transport.Rest/Demo.LicenseTrack.Client.Transport.Rest.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
<ItemGroup>
1414
<ProjectReference Include="..\Demo.LicenseTrack.App.Model\Demo.LicenseTrack.App.Model.csproj" />
15+
<ProjectReference Include="..\Demo.LicenseTrack.Client.Contracts\Demo.LicenseTrack.Client.Contracts.csproj" />
1516
<ProjectReference Include="..\Demo.LicenseTrack.Transport.Rest.Model\Demo.LicenseTrack.Transport.Rest.Model.csproj" />
1617
</ItemGroup>
1718

Demos/LicenseTrack/AppCode/Demo.LicenseTrack.Client.Transport.Rest/LibraryLoader.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,12 @@ protected override void LoadManualRegistration(IServiceCollection serviceCollect
3434
}
3535

3636

37+
3738
/// <summary>
38-
/// Loads transient service registrations with the hosting DI container.
39+
/// Automated registration of classes using transient registration.
3940
/// </summary>
40-
/// <param name="serviceCollection">The dependency injection provider to register services with.</param>
41-
/// <param name="configuration">The source configuration to provide for dependency injection.</param>
41+
/// <param name="serviceCollection">The service collection to register services.</param>
42+
/// <param name="configuration">The configuration data used with register of services.</param>
4243
protected override void LoadRegistration(IServiceCollection serviceCollection, IConfiguration configuration)
4344
{
4445
//Intentionally blank
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using System.Text.Json.Serialization;
7+
8+
namespace Demo.LicenseTrack.Client.Transport.Rest
9+
{
10+
/// <summary>
11+
/// A machine-readable format for specifying errors in HTTP API responses based on <see href="https://tools.ietf.org/html/rfc7807"/>.
12+
/// </summary>
13+
/// <remarks> Directly cloned from <see href="https://github.com/dotnet/aspnetcore/blob/main/src/Http/Http.Abstractions/src/ProblemDetails/ProblemDetails.cs"/> No changes were made to this code. This code file is from the .net foundation used under the MIT license.</remarks>
14+
public class ProblemDetails
15+
{
16+
/// <summary>
17+
/// A URI reference [RFC3986] that identifies the problem type. This specification encourages that, when
18+
/// dereferenced, it provide human-readable documentation for the problem type
19+
/// (e.g., using HTML [W3C.REC-html5-20141028]). When this member is not present, its value is assumed to be
20+
/// "about:blank".
21+
/// </summary>
22+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
23+
[JsonPropertyOrder(-5)]
24+
public string? Type { get; set; }
25+
26+
/// <summary>
27+
/// A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence
28+
/// of the problem, except for purposes of localization(e.g., using proactive content negotiation;
29+
/// see[RFC7231], Section 3.4).
30+
/// </summary>
31+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
32+
[JsonPropertyOrder(-4)]
33+
public string? Title { get; set; }
34+
35+
/// <summary>
36+
/// The HTTP status code([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
37+
/// </summary>
38+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
39+
[JsonPropertyOrder(-3)]
40+
public int? Status { get; set; }
41+
42+
/// <summary>
43+
/// A human-readable explanation specific to this occurrence of the problem.
44+
/// </summary>
45+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
46+
[JsonPropertyOrder(-2)]
47+
public string? Detail { get; set; }
48+
49+
/// <summary>
50+
/// A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
51+
/// </summary>
52+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
53+
[JsonPropertyOrder(-1)]
54+
public string? Instance { get; set; }
55+
56+
/// <summary>
57+
/// Gets the <see cref="IDictionary{TKey, TValue}"/> for extension members.
58+
/// <para>
59+
/// Problem type definitions MAY extend the problem details object with additional members. Extension members appear in the same namespace as
60+
/// other members of a problem type.
61+
/// </para>
62+
/// </summary>
63+
/// <remarks>
64+
/// The round-tripping behavior for <see cref="Extensions"/> is determined by the implementation of the Input \ Output formatters.
65+
/// In particular, complex types or collection types may not round-trip to the original type when using the built-in JSON or XML formatters.
66+
/// </remarks>
67+
[JsonExtensionData]
68+
public IDictionary<string, object?> Extensions { get; set; } = new Dictionary<string, object?>(StringComparer.Ordinal);
69+
}
70+
}

0 commit comments

Comments
 (0)