Skip to content

Commit

Permalink
rename to Forecast
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Feb 28, 2024
1 parent 7ee4a63 commit e67389f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions MyApp.Client/src/dtos.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Options:
Date: 2024-02-11 15:34:32
Date: 2024-02-28 19:40:08
Version: 8.13
Tip: To override a DTO option, remove "//" prefix before updating
BaseUrl: https://localhost:5001
Expand Down Expand Up @@ -229,14 +229,14 @@ export class Booking extends AuditBase
public constructor(init?: Partial<Booking>) { super(init); (Object as any).assign(this, init); }
}

export class WeatherForecast implements IGet
export class Forecast implements IGet
{
public date: string;
public temperatureC: number;
public summary?: string;
public temperatureF: number;

public constructor(init?: Partial<WeatherForecast>) { (Object as any).assign(this, init); }
public constructor(init?: Partial<Forecast>) { (Object as any).assign(this, init); }
}

export class PageStats
Expand Down Expand Up @@ -440,14 +440,14 @@ export class Hello implements IReturn<HelloResponse>, IGet
public createResponse() { return new HelloResponse(); }
}

export class GetWeatherForecast implements IReturn<WeatherForecast[]>, IGet
export class GetWeatherForecast implements IReturn<Forecast[]>, IGet
{
public date?: string;

public constructor(init?: Partial<GetWeatherForecast>) { (Object as any).assign(this, init); }
public getTypeName() { return 'GetWeatherForecast'; }
public getMethod() { return 'GET'; }
public createResponse() { return new Array<WeatherForecast>(); }
public createResponse() { return new Array<Forecast>(); }
}

export class AdminData implements IReturn<AdminDataResponse>, IGet
Expand Down
2 changes: 1 addition & 1 deletion MyApp.ServiceInterface/MyServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public object Any(Hello request)
public object Any(GetWeatherForecast request)
{
var rng = new Random();
return Enumerable.Range(1, 5).Select(index => new WeatherForecast(
return Enumerable.Range(1, 5).Select(index => new Forecast(
Date: (request.Date ?? DateOnly.FromDateTime(DateTime.Now)).AddDays(index),
TemperatureC: rng.Next(-20, 55),
Summary: summaries[rng.Next(summaries.Length)]
Expand Down
4 changes: 2 additions & 2 deletions MyApp.ServiceModel/Hello.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ public class HelloResponse
public required string Result { get; set; }
}

public class GetWeatherForecast : IGet, IReturn<WeatherForecast[]>
public class GetWeatherForecast : IGet, IReturn<Forecast[]>
{
public required DateOnly? Date { get; set; }
}

public record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary) : IGet, IReturn<WeatherForecast[]>
public record Forecast(DateOnly Date, int TemperatureC, string? Summary) : IGet, IReturn<Forecast[]>
{
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
}

0 comments on commit e67389f

Please sign in to comment.