Skip to content

Commit 9b71d7f

Browse files
committed
Tests and examples updated
1 parent 355603a commit 9b71d7f

File tree

65 files changed

+738
-87
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+738
-87
lines changed

Examples/Angular/ModelFromAssembly/ModelFromAssembly.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="KY.Generator" Version="6.6.3" />
10-
<PackageReference Include="KY.Generator.Annotations" Version="6.6.3" />
9+
<PackageReference Include="KY.Generator" Version="6.6.5" />
10+
<PackageReference Include="KY.Generator.Annotations" Version="6.6.5" />
1111
</ItemGroup>
1212

1313
</Project>

Examples/Angular/ModelFromAssembly/Output/another-type.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ------------------------------------------------------------------------------
22
// <auto-generated>
3-
// This code was generated with KY.Generator 6.6.3.0
3+
// This code was generated with KY.Generator 6.6.5.0
44
//
55
// Manual changes to this file may cause unexpected behavior in your application.
66
// Manual changes to this file will be overwritten if the code is regenerated.

Examples/Angular/ModelFromAssembly/Output/type-to-read.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ------------------------------------------------------------------------------
22
// <auto-generated>
3-
// This code was generated with KY.Generator 6.6.3.0
3+
// This code was generated with KY.Generator 6.6.5.0
44
//
55
// Manual changes to this file may cause unexpected behavior in your application.
66
// Manual changes to this file will be overwritten if the code is regenerated.

Examples/Angular/ServiceFromAspNetCoreAnnotation/ClientApp/src/app/models/weather-forecast.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ------------------------------------------------------------------------------
22
// <auto-generated>
3-
// This code was generated with KY.Generator 6.6.3.0
3+
// This code was generated with KY.Generator 6.6.5.0
44
//
55
// Manual changes to this file may cause unexpected behavior in your application.
66
// Manual changes to this file will be overwritten if the code is regenerated.

Examples/Angular/ServiceFromAspNetCoreAnnotation/ClientApp/src/app/services/weather-forecast.service.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ------------------------------------------------------------------------------
22
// <auto-generated>
3-
// This code was generated with KY.Generator 6.6.3.0
3+
// This code was generated with KY.Generator 6.6.5.0
44
//
55
// Manual changes to this file may cause unexpected behavior in your application.
66
// Manual changes to this file will be overwritten if the code is regenerated.
@@ -29,11 +29,18 @@ export class WeatherForecastService {
2929
public get(httpOptions: {} = undefined): Observable<WeatherForecast[]> {
3030
let subject = new Subject<WeatherForecast[]>();
3131
this.http.get<WeatherForecast[]>(this.serviceUrl + "/weatherforecast", httpOptions).subscribe((result) => {
32+
if (result) {
33+
result.forEach((entry) => entry.date = this.convertToDate(entry.date));
34+
}
3235
subject.next(result);
3336
subject.complete();
3437
}, (error) => subject.error(error));
3538
return subject;
3639
}
40+
41+
public convertToDate(value: string | Date): Date {
42+
return typeof(value) === "string" ? new Date(value) : value;
43+
}
3744
}
3845

3946
// outputid:c2cd74cf-53e6-4c11-86de-4f23690f7cf8

Examples/Angular/ServiceFromAspNetCoreAnnotation/ServiceFromAspNetCoreAnnotation.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
</PropertyGroup>
1515

1616
<ItemGroup>
17-
<PackageReference Include="KY.Generator" Version="6.6.3" />
18-
<PackageReference Include="KY.Generator.Annotations" Version="6.6.3" />
17+
<PackageReference Include="KY.Generator" Version="6.6.5" />
18+
<PackageReference Include="KY.Generator.Annotations" Version="6.6.5" />
1919
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="3.1.7" />
2020
</ItemGroup>
2121

Examples/Angular/ServiceFromAspNetCoreSignalRHub/ClientApp/src/app/models/connection-status.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ------------------------------------------------------------------------------
22
// <auto-generated>
3-
// This code was generated with KY.Generator 6.6.3.0
3+
// This code was generated with KY.Generator 6.6.5.0
44
//
55
// Manual changes to this file may cause unexpected behavior in your application.
66
// Manual changes to this file will be overwritten if the code is regenerated.

Examples/Angular/ServiceFromAspNetCoreSignalRHub/ClientApp/src/app/models/weather-forecast.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ------------------------------------------------------------------------------
22
// <auto-generated>
3-
// This code was generated with KY.Generator 6.6.3.0
3+
// This code was generated with KY.Generator 6.6.5.0
44
//
55
// Manual changes to this file may cause unexpected behavior in your application.
66
// Manual changes to this file will be overwritten if the code is regenerated.

Examples/Angular/ServiceFromAspNetCoreSignalRHub/ClientApp/src/app/services/weather-hub.service.ts

+17-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ------------------------------------------------------------------------------
22
// <auto-generated>
3-
// This code was generated with KY.Generator 6.6.3.0
3+
// This code was generated with KY.Generator 6.6.5.0
44
//
55
// Manual changes to this file may cause unexpected behavior in your application.
66
// Manual changes to this file will be overwritten if the code is regenerated.
@@ -26,6 +26,7 @@ import { Subject } from "rxjs";
2626
providedIn: "root"
2727
})
2828
export class WeatherHubService {
29+
private isClosed: bool;
2930
public serviceUrl: string = "";
3031
private connection: ReplaySubject<HubConnection>;
3132
private readonly timeouts: number[] = [0, 0, 1000, 2000, 5000];
@@ -38,11 +39,12 @@ export class WeatherHubService {
3839
if (! this.serviceUrl) {
3940
throw new Error("serviceUrl can not be empty. Set it via service.serviceUrl.")
4041
}
41-
if (this.connection) {
42+
if (this.connection && ! this.isClosed) {
4243
return this.status$.pipe(filter((status) => status === ConnectionStatus.connected), take(1), map(() => {
4344
}));
4445
}
45-
this.connection = new ReplaySubject<HubConnection>(1);
46+
this.isClosed = false;
47+
this.connection = this.connection ? this.connection : new ReplaySubject<HubConnection>(1);
4648
let hubConnection: HubConnection = new HubConnectionBuilder().withUrl(this.serviceUrl).build();
4749
let startConnection: () => Observable<void> = () => {
4850
this.statusSubject.next(ConnectionStatus.connecting);
@@ -67,12 +69,23 @@ export class WeatherHubService {
6769
this.updatedSubject.next(forecast);
6870
});
6971
hubConnection.onclose(() => {
70-
startConnection();
72+
if (! this.isClosed) {
73+
startConnection();
74+
}
7175
});
7276
this.connection.next(hubConnection);
7377
return startConnection();
7478
}
7579

80+
public disconnect(): void {
81+
this.isClosed = true;
82+
this.connection.subscribe((hubConnection) => {
83+
hubConnection.stop().then(() => {
84+
this.statusSubject.next(ConnectionStatus.disconnected);
85+
});
86+
});
87+
}
88+
7689
public fetch(): Observable<void> {
7790
let subject = new Subject<void>();
7891
this.connect().pipe(mergeMap(() => this.connection), take(1), mergeMap((connection) => connection.send("Fetch"))).subscribe(() => {

Examples/Angular/ServiceFromAspNetCoreSignalRHub/ServiceFromAspNetCoreSignalRHub.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
</PropertyGroup>
1515

1616
<ItemGroup>
17-
<PackageReference Include="KY.Generator" Version="6.6.3" />
18-
<PackageReference Include="KY.Generator.Annotations" Version="6.6.3" />
17+
<PackageReference Include="KY.Generator" Version="6.6.5" />
18+
<PackageReference Include="KY.Generator.Annotations" Version="6.6.5" />
1919
<PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.1.0" />
2020
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="3.1.7" />
2121
</ItemGroup>

Examples/Angular/ServiceFromAspNetCoreViaFluentApi/Generator/Generator.csproj

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="KY.Generator" Version="6.6.3" />
9-
<PackageReference Include="KY.Generator.Angular" Version="6.6.3" />
10-
<PackageReference Include="KY.Generator.AspDotNet" Version="6.6.3" />
11-
<PackageReference Include="KY.Generator.Fluent" Version="6.6.3" />
12-
<PackageReference Include="KY.Generator.Reflection" Version="6.6.3" />
8+
<PackageReference Include="KY.Generator" Version="6.6.5" />
9+
<PackageReference Include="KY.Generator.Angular" Version="6.6.5" />
10+
<PackageReference Include="KY.Generator.AspDotNet" Version="6.6.5" />
11+
<PackageReference Include="KY.Generator.Fluent" Version="6.6.5" />
12+
<PackageReference Include="KY.Generator.Reflection" Version="6.6.5" />
1313
</ItemGroup>
1414

1515
<ItemGroup>

Examples/Angular/ServiceFromSignalRViaFluentApi/ServiceFromSignalRViaFluentApi.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="KY.Generator" Version="6.6.3" />
17-
<PackageReference Include="KY.Generator.Angular" Version="6.6.3" />
18-
<PackageReference Include="KY.Generator.Fluent" Version="6.6.3" />
19-
<PackageReference Include="KY.Generator.Reflection" Version="6.6.3" />
16+
<PackageReference Include="KY.Generator" Version="6.6.5" />
17+
<PackageReference Include="KY.Generator.Angular" Version="6.6.5" />
18+
<PackageReference Include="KY.Generator.Fluent" Version="6.6.5" />
19+
<PackageReference Include="KY.Generator.Reflection" Version="6.6.5" />
2020
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="5.0.1" />
2121
</ItemGroup>
2222

Examples/Reflection/ReflectionFromAttributes/Output/type-to-read.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ------------------------------------------------------------------------------
22
// <auto-generated>
3-
// This code was generated with KY.Generator 6.6.3.0
3+
// This code was generated with KY.Generator 6.6.5.0
44
//
55
// Manual changes to this file may cause unexpected behavior in your application.
66
// Manual changes to this file will be overwritten if the code is regenerated.

Examples/Reflection/ReflectionFromAttributes/ReflectionFromAttributes.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="KY.Generator" Version="6.6.3" />
10-
<PackageReference Include="KY.Generator.Annotations" Version="6.6.3" />
9+
<PackageReference Include="KY.Generator" Version="6.6.5" />
10+
<PackageReference Include="KY.Generator.Annotations" Version="6.6.5" />
1111
</ItemGroup>
1212

1313
</Project>

Examples/Reflection/ReflectionFromConstant/Output/class-1.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ------------------------------------------------------------------------------
22
// <auto-generated>
3-
// This code was generated with KY.Generator 6.6.3.0
3+
// This code was generated with KY.Generator 6.6.5.0
44
//
55
// Manual changes to this file may cause unexpected behavior in your application.
66
// Manual changes to this file will be overwritten if the code is regenerated.

Examples/Reflection/ReflectionFromConstant/ReflectionFromConstant.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="KY.Generator" Version="6.6.3" />
10-
<PackageReference Include="KY.Generator.Annotations" Version="6.6.3" />
9+
<PackageReference Include="KY.Generator" Version="6.6.5" />
10+
<PackageReference Include="KY.Generator.Annotations" Version="6.6.5" />
1111
</ItemGroup>
1212

1313
</Project>

Examples/Reflection/ReflectionFromCore/Output/type-to-read.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ------------------------------------------------------------------------------
22
// <auto-generated>
3-
// This code was generated with KY.Generator 6.6.3.0
3+
// This code was generated with KY.Generator 6.6.5.0
44
//
55
// Manual changes to this file may cause unexpected behavior in your application.
66
// Manual changes to this file will be overwritten if the code is regenerated.

Examples/Reflection/ReflectionFromCore/ReflectionFromCore.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="KY.Generator" Version="6.6.3" />
11-
<PackageReference Include="KY.Generator.Annotations" Version="6.6.3" />
10+
<PackageReference Include="KY.Generator" Version="6.6.5" />
11+
<PackageReference Include="KY.Generator.Annotations" Version="6.6.5" />
1212
</ItemGroup>
1313

1414
</Project>

Examples/Reflection/ReflectionFromIndex/Output/another-type.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ------------------------------------------------------------------------------
22
// <auto-generated>
3-
// This code was generated with KY.Generator 6.6.3.0
3+
// This code was generated with KY.Generator 6.6.5.0
44
//
55
// Manual changes to this file may cause unexpected behavior in your application.
66
// Manual changes to this file will be overwritten if the code is regenerated.

Examples/Reflection/ReflectionFromIndex/Output/type-to-read.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ------------------------------------------------------------------------------
22
// <auto-generated>
3-
// This code was generated with KY.Generator 6.6.3.0
3+
// This code was generated with KY.Generator 6.6.5.0
44
//
55
// Manual changes to this file may cause unexpected behavior in your application.
66
// Manual changes to this file will be overwritten if the code is regenerated.

Examples/Reflection/ReflectionFromIndex/ReflectionFromIndex.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="KY.Generator" Version="6.6.3" />
10-
<PackageReference Include="KY.Generator.Annotations" Version="6.6.3" />
9+
<PackageReference Include="KY.Generator" Version="6.6.5" />
10+
<PackageReference Include="KY.Generator.Annotations" Version="6.6.5" />
1111
</ItemGroup>
1212

1313
<ItemGroup>

Examples/Reflection/ReflectionFromMultipleAssemblies/MainAssembly/MainAssembly.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="KY.Generator" Version="6.6.3" />
10-
<PackageReference Include="KY.Generator.Annotations" Version="6.6.3" />
9+
<PackageReference Include="KY.Generator" Version="6.6.5" />
10+
<PackageReference Include="KY.Generator.Annotations" Version="6.6.5" />
1111
</ItemGroup>
1212

1313
<ItemGroup>

Examples/Reflection/ReflectionFromMultipleAssemblies/MainAssembly/Output/second-type.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ------------------------------------------------------------------------------
22
// <auto-generated>
3-
// This code was generated with KY.Generator 6.6.3.0
3+
// This code was generated with KY.Generator 6.6.5.0
44
//
55
// Manual changes to this file may cause unexpected behavior in your application.
66
// Manual changes to this file will be overwritten if the code is regenerated.

Examples/Reflection/ReflectionFromMultipleAssemblies/MainAssembly/Output/type-to-read.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ------------------------------------------------------------------------------
22
// <auto-generated>
3-
// This code was generated with KY.Generator 6.6.3.0
3+
// This code was generated with KY.Generator 6.6.5.0
44
//
55
// Manual changes to this file may cause unexpected behavior in your application.
66
// Manual changes to this file will be overwritten if the code is regenerated.

Examples/Reflection/ReflectionFromNet5/Output/type-to-read.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ------------------------------------------------------------------------------
22
// <auto-generated>
3-
// This code was generated with KY.Generator 6.6.3.0
3+
// This code was generated with KY.Generator 6.6.5.0
44
//
55
// Manual changes to this file may cause unexpected behavior in your application.
66
// Manual changes to this file will be overwritten if the code is regenerated.

Examples/Reflection/ReflectionFromNet5/ReflectionFromNet5.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="KY.Generator" Version="6.6.3" />
10-
<PackageReference Include="KY.Generator.Annotations" Version="6.6.3" />
9+
<PackageReference Include="KY.Generator" Version="6.6.5" />
10+
<PackageReference Include="KY.Generator.Annotations" Version="6.6.5" />
1111
</ItemGroup>
1212

1313
</Project>

Examples/Reflection/ReflectionFromStandard/Output/type-to-read.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ------------------------------------------------------------------------------
22
// <auto-generated>
3-
// This code was generated with KY.Generator 6.6.3.0
3+
// This code was generated with KY.Generator 6.6.5.0
44
//
55
// Manual changes to this file may cause unexpected behavior in your application.
66
// Manual changes to this file will be overwritten if the code is regenerated.

Examples/Reflection/ReflectionFromStandard/ReflectionFromStandard.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="KY.Generator" Version="6.6.3" />
10-
<PackageReference Include="KY.Generator.Annotations" Version="6.6.3" />
9+
<PackageReference Include="KY.Generator" Version="6.6.5" />
10+
<PackageReference Include="KY.Generator.Annotations" Version="6.6.5" />
1111
</ItemGroup>
1212

1313
</Project>

Examples/Reflection/ReflectionIgnoreAttribute/Output/type-to-read.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ------------------------------------------------------------------------------
22
// <auto-generated>
3-
// This code was generated with KY.Generator 6.6.3.0
3+
// This code was generated with KY.Generator 6.6.5.0
44
//
55
// Manual changes to this file may cause unexpected behavior in your application.
66
// Manual changes to this file will be overwritten if the code is regenerated.

Examples/Reflection/ReflectionIgnoreAttribute/ReflectionIgnoreAttribute.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="KY.Generator" Version="6.6.3" />
10-
<PackageReference Include="KY.Generator.Annotations" Version="6.6.3" />
9+
<PackageReference Include="KY.Generator" Version="6.6.5" />
10+
<PackageReference Include="KY.Generator.Annotations" Version="6.6.5" />
1111
</ItemGroup>
1212

1313
</Project>

Examples/Reflection/ReflectionX86/ReflectionX86.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="KY.Generator" Version="6.6.3" />
11-
<PackageReference Include="KY.Generator.Annotations" Version="6.6.3" />
10+
<PackageReference Include="KY.Generator" Version="6.6.5" />
11+
<PackageReference Include="KY.Generator.Annotations" Version="6.6.5" />
1212
</ItemGroup>
1313

1414
</Project>

Examples/Reflection/ReflectionX86/type-to-read.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ------------------------------------------------------------------------------
22
// <auto-generated>
3-
// This code was generated with KY.Generator 6.6.3.0
3+
// This code was generated with KY.Generator 6.6.5.0
44
//
55
// Manual changes to this file may cause unexpected behavior in your application.
66
// Manual changes to this file will be overwritten if the code is regenerated.

Examples/build.cmd

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
cd Angular
22
call build.cmd
3-
cd ..
3+
cd ../
44

55
cd Reflection
66
call build.cmd
7-
cd ..
7+
cd ../
88

99
PAUSE

Tests/AnnotationAsync/AnnotationAsync.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="KY.Generator" Version="6.6.3" />
11-
<PackageReference Include="KY.Generator.Annotations" Version="6.6.3" />
10+
<PackageReference Include="KY.Generator" Version="6.6.5" />
11+
<PackageReference Include="KY.Generator.Annotations" Version="6.6.5" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

0 commit comments

Comments
 (0)