CORS, Theme, Better flow and dotnet tools

This commit is contained in:
2023-01-04 09:38:00 -07:00
parent a3938d1916
commit 978e698da5
72 changed files with 528 additions and 774 deletions

View File

@ -1,11 +0,0 @@
namespace Expose.MyIT.Shared.Models.Stateless;
public interface IServiceShopOrderController
{
enum Action : int
{
All = 0
}
}

View File

@ -1,11 +0,0 @@
namespace Expose.MyIT.Shared.Models.Stateless;
public interface ISsaOrderController
{
enum Action : int
{
All = 0
}
}

View File

@ -1,9 +0,0 @@
using System.Text.Json.Serialization;
namespace Expose.MyIT.Shared.Models;
public record Order2(
[property: JsonPropertyName("Id")] string Id,
[property: JsonPropertyName("Name")] string Name,
[property: JsonPropertyName("TypeId")] int TypeId
);

View File

@ -2,7 +2,7 @@ using System.Text.Json.Serialization;
namespace Expose.MyIT.Shared.Models;
public record SSA(
public record Ssa(
[property: JsonPropertyName("Orders")] IReadOnlyList<Order> Orders,
[property: JsonPropertyName("Total")] int Total
);

View File

@ -0,0 +1,14 @@
namespace Expose.MyIT.Shared.Models.Stateless;
public interface IAppSettingsController<T>
{
enum Action : int
{
App = 0
}
static string GetRouteName() => nameof(IAppSettingsController<T>)[1..^10];
T GetAppSettings();
}

View File

@ -0,0 +1,8 @@
namespace Expose.MyIT.Shared.Models.Stateless;
public interface IAppSettingsRepository
{
List<string> GetAppSettings();
}

View File

@ -0,0 +1,16 @@
namespace Expose.MyIT.Shared.Models.Stateless;
public interface IClientSettingsController<T>
{
enum Action : int
{
Client = 0,
IP = 1
}
static string GetRouteName() => nameof(IClientSettingsController<T>)[1..^10];
T GetClientSettings();
T GetIpAddress();
}

View File

@ -0,0 +1,11 @@
using System.Net;
namespace Expose.MyIT.Shared.Models.Stateless;
public interface IClientSettingsRepository
{
List<string> GetClientSettings(IPAddress? remoteIpAddress);
string GetIpAddress(IPAddress? remoteIpAddress);
}

View File

@ -1,6 +1,6 @@
using System.Runtime.CompilerServices;
namespace Expose.MyIT.Shared.Models.Stateless.Methods;
namespace Expose.MyIT.Shared.Models.Stateless;
public interface IMethodName
{

View File

@ -1,4 +1,4 @@
namespace Expose.MyIT.Shared.Models.Stateless.Methods;
namespace Expose.MyIT.Shared.Models.Stateless;
public interface IServiceShopOrder
{
@ -6,6 +6,6 @@ public interface IServiceShopOrder
ViewModels.ServiceShopOrder[] TestStatic_GetServiceShopOrders(ServiceShop? serviceShop) =>
GetServiceShopOrders(serviceShop);
static ViewModels.ServiceShopOrder[] GetServiceShopOrders(ServiceShop? serviceShop) =>
ServiceShopOrder.GetServiceShopOrders(serviceShop);
ServiceShopOrder.GetServiceShopOrders(serviceShop);
}

View File

@ -0,0 +1,15 @@
namespace Expose.MyIT.Shared.Models.Stateless;
public interface IServiceShopOrderController<T>
{
enum Action : int
{
All = 0
}
static string GetRouteName() => nameof(IServiceShopOrderController<T>)[1..^10];
Task<T> GetAllServiceShopOrders();
Task<T> GetServiceShopOrders(string id);
}

View File

@ -1,4 +1,4 @@
namespace Expose.MyIT.Shared.Models.Methods;
namespace Expose.MyIT.Shared.Models.Stateless;
public interface IServiceShopOrderRepository
{

View File

@ -0,0 +1,11 @@
namespace Expose.MyIT.Shared.Models.Stateless;
public interface ISsaOrder
{
ViewModels.SsaOrder[] TestStatic_GetSsaOrders(Ssa? ssa) =>
GetSsaOrders(ssa);
static ViewModels.SsaOrder[] GetSsaOrders(Ssa? ssa) =>
SsaOrder.GetSsaOrders(ssa);
}

View File

@ -0,0 +1,15 @@
namespace Expose.MyIT.Shared.Models.Stateless;
public interface ISsaOrderController<T>
{
enum Action : int
{
All = 0
}
static string GetRouteName() => nameof(ISsaOrderController<T>)[1..^10];
Task<T> GetAllSsaOrders();
Task<T> GetSsaOrders(string id);
}

View File

@ -1,4 +1,4 @@
namespace Expose.MyIT.Shared.Models.Methods;
namespace Expose.MyIT.Shared.Models.Stateless;
public interface ISsaOrderRepository
{

View File

@ -0,0 +1,9 @@
namespace Expose.MyIT.Shared.Models.Stateless;
public interface IWeatherForecastController<T>
{
static string GetRouteName() => nameof(IWeatherForecastController<T>)[1..^10];
T Get();
}

View File

@ -1,9 +0,0 @@
namespace Expose.MyIT.Shared.Models.Stateless.Methods;
public interface IAppSettingsController
{
static string GetRouteName() => nameof(IAppSettingsController)[1..^10];
string[] GetAppSettings();
}

View File

@ -1,10 +0,0 @@
namespace Expose.MyIT.Shared.Models.Stateless.Methods;
public interface IClientSettingsController
{
static string GetRouteName() => nameof(IClientSettingsController)[1..^10];
string[] GetClientSettings();
string GetIpAddress();
}

View File

@ -1,10 +0,0 @@
namespace Expose.MyIT.Shared.Models.Stateless.Methods;
public interface IServiceShopOrderController
{
static string GetRouteName() => nameof(IServiceShopOrderController)[1..^10];
Task<ViewModels.ServiceShopOrder[]> GetAllServiceShopOrders();
Task<ViewModels.ServiceShopOrder[]> GetServiceShopOrders(string id);
}

View File

@ -1,11 +0,0 @@
namespace Expose.MyIT.Shared.Models.Stateless.Methods;
public interface ISsaOrder
{
ViewModels.SsaOrder[] TestStatic_GetSsaOrders(SSA? ssa) =>
GetSsaOrders(ssa);
static ViewModels.SsaOrder[] GetSsaOrders(SSA? ssa) =>
SsaOrder.GetSsaOrders(ssa);
}

View File

@ -1,10 +0,0 @@
namespace Expose.MyIT.Shared.Models.Stateless.Methods;
public interface ISsaOrderController
{
static string GetRouteName() => nameof(ISsaOrderController)[1..^10];
Task<ViewModels.SsaOrder[]> GetAllSsaOrders();
Task<ViewModels.SsaOrder[]> GetSsaOrders(string id);
}

View File

@ -1,9 +0,0 @@
namespace Expose.MyIT.Shared.Models.Stateless.Methods;
public interface IWeatherForecastController
{
static string GetRouteName() => nameof(IWeatherForecastController)[1..^10];
Task<ViewModels.WeatherForecast[]> Get();
}

View File

@ -1,6 +1,6 @@
namespace Expose.MyIT.Shared.Models.Stateless.Methods;
namespace Expose.MyIT.Shared.Models.Stateless;
internal class ServiceShopOrder
internal abstract class ServiceShopOrder
{
internal static ViewModels.ServiceShopOrder[] GetServiceShopOrders(ServiceShop? serviceShop)

View File

@ -1,9 +1,9 @@
namespace Expose.MyIT.Shared.Models.Stateless.Methods;
namespace Expose.MyIT.Shared.Models.Stateless;
internal class SsaOrder
internal abstract class SsaOrder
{
internal static ViewModels.SsaOrder[] GetSsaOrders(SSA? ssa)
internal static ViewModels.SsaOrder[] GetSsaOrders(Ssa? ssa)
{
ViewModels.SsaOrder[] results;
if (ssa is null || !ssa.Orders.Any())

View File

@ -2,34 +2,18 @@ using System.Text.Json;
namespace Expose.MyIT.Shared.ViewModels;
public class ServiceShopOrder
public record ServiceShopOrder(string Id,
string Name,
string[] BookingNames,
string Type,
string State,
string ItemNumber,
DateTime CreatedDate,
DateTime DecidedDate,
string Recipient,
string Requestor)
{
public string Id { init; get; }
public string Name { init; get; }
public string[] BookingNames { init; get; }
public string Type { init; get; }
public string State { init; get; }
public string ItemNumber { init; get; }
public DateTime CreatedDate { init; get; }
public DateTime DecidedDate { init; get; }
public string Recipient { init; get; }
public string Requestor { init; get; }
public ServiceShopOrder(string id, string name, string[] bookingNames, string type, string state, string itemNumber, DateTime createdDate, DateTime decidedDate, string recipient, string requestor)
{
Id = id;
Name = name;
BookingNames = bookingNames;
Type = type;
State = state;
ItemNumber = itemNumber;
CreatedDate = createdDate;
DecidedDate = decidedDate;
Recipient = recipient;
Requestor = requestor;
}
public ServiceShopOrder(Models.Order order) :
this(order.Id,
order.Name,

View File

@ -2,34 +2,18 @@ using System.Text.Json;
namespace Expose.MyIT.Shared.ViewModels;
public class SsaOrder
public record SsaOrder(string Id,
string Name,
string[] BookingNames,
string Type,
string State,
string ItemNumber,
DateTime CreatedDate,
DateTime DecidedDate,
string Recipient,
string Requestor)
{
public string Id { init; get; }
public string Name { init; get; }
public string[] BookingNames { init; get; }
public string Type { init; get; }
public string State { init; get; }
public string ItemNumber { init; get; }
public DateTime CreatedDate { init; get; }
public DateTime DecidedDate { init; get; }
public string Recipient { init; get; }
public string Requestor { init; get; }
public SsaOrder(string id, string name, string[] bookingNames, string type, string state, string itemNumber, DateTime createdDate, DateTime decidedDate, string recipient, string requestor)
{
Id = id;
Name = name;
BookingNames = bookingNames;
Type = type;
State = state;
ItemNumber = itemNumber;
CreatedDate = createdDate;
DecidedDate = decidedDate;
Recipient = recipient;
Requestor = requestor;
}
public SsaOrder(Models.Order order) :
this(order.Id,
order.Name,

View File

@ -1,25 +1,14 @@
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Expose.MyIT.Shared.ViewModels;
public class WeatherForecast
public record WeatherForecast
{
public DateOnly Date { init; get; }
public int TemperatureC { init; get; }
public string? Summary { init; get; }
public int TemperatureF { init; get; }
public WeatherForecast(DateOnly date, int temperatureC, string? summary, int temperatureF)
{
Date = date;
TemperatureC = temperatureC;
Summary = summary;
TemperatureF = temperatureF;
}
[JsonConstructor]
public WeatherForecast(DateOnly Date, int TemperatureC, string? Summary, int TemperatureF)
{ }
public WeatherForecast(Models.WeatherForecast weatherForecast) :
this(weatherForecast.Date,