Added Newtonsoft JSON.
Added input formatter for Cart saving. Added preload for INV, Customers.
This commit is contained in:
parent
6466d17905
commit
677582d4bb
47
Program.cs
47
Program.cs
@ -1,18 +1,32 @@
|
|||||||
|
|
||||||
|
using CVRLIB.CVENVIRONMENT;
|
||||||
|
using static CVRLIB.CVGlobal;
|
||||||
|
|
||||||
|
using CA_ANC.Formatters;
|
||||||
|
using CVRLIB;
|
||||||
|
using CVRLIB.Inventory;
|
||||||
|
using CVRLIB.Customers;
|
||||||
|
|
||||||
//ZXING.dll does not copy properly to publish folder, copy manually from another lib, ie cvrlib-nf.
|
//ZXING.dll does not copy properly to publish folder, copy manually from another lib, ie cvrlib-nf.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
// Add services to the container.
|
// Add services to the container.
|
||||||
builder.Services.AddRazorPages();
|
builder.Services.AddRazorPages();
|
||||||
|
|
||||||
builder.Services.AddControllers().AddJsonOptions((options => {
|
//builder.Services.AddControllers().AddJsonOptions((options => {
|
||||||
//was changing PRINTER_NAME to printeR_NAME (pascal Case: https://github.com/dotnet/runtime/issues/30887)
|
// //was changing PRINTER_NAME to printeR_NAME (pascal Case: https://github.com/dotnet/runtime/issues/30887)
|
||||||
options.JsonSerializerOptions.PropertyNamingPolicy = null;
|
// options.JsonSerializerOptions.PropertyNamingPolicy = null;
|
||||||
}));
|
//}));
|
||||||
|
|
||||||
|
|
||||||
|
builder.Services
|
||||||
|
.AddControllers(options => { options.InputFormatters.Add(new ByteArrayInputFormatter()); })
|
||||||
|
.AddNewtonsoftJson()
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
@ -27,6 +41,14 @@ if (!app.Environment.IsDevelopment()) {
|
|||||||
VSERVERWS.Global.Globals.IsDevelopment = app.Environment.IsDevelopment();
|
VSERVERWS.Global.Globals.IsDevelopment = app.Environment.IsDevelopment();
|
||||||
|
|
||||||
|
|
||||||
|
VSERVERWS.Global.Globals.LoadPrinters();
|
||||||
|
|
||||||
|
|
||||||
|
CVGlobal.TryGlobalPRELoadCVCollections(new[] { typeof(CVINVENTORY), typeof(CVCustomers) });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
app.UseHttpsRedirection();
|
app.UseHttpsRedirection();
|
||||||
app.UseStaticFiles();
|
app.UseStaticFiles();
|
||||||
@ -42,4 +64,19 @@ app.MapRazorPages();
|
|||||||
app.Run();
|
app.Run();
|
||||||
|
|
||||||
|
|
||||||
VSERVERWS.Global.Globals.LoadPrinters();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public partial class Program {
|
||||||
|
|
||||||
|
public static CVSECRETS? CVS { get; set; } = null;
|
||||||
|
public static string AppPath { get; set; } = "";
|
||||||
|
public static string HTTPROOT { get; set; } = "";
|
||||||
|
public static bool IsDevMode { get; set; } = false;
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0-windows</TargetFramework>
|
<TargetFramework>net6.0-windows</TargetFramework>
|
||||||
@ -9,12 +9,31 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="11.3.0" />
|
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="11.3.0" />
|
||||||
<PackageReference Include="Magick.NET.Core" Version="11.3.0" />
|
<PackageReference Include="Magick.NET.Core" Version="11.3.0" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.16" />
|
||||||
<PackageReference Include="Microsoft.Windows.Compatibility" Version="6.0.0" />
|
<PackageReference Include="Microsoft.Windows.Compatibility" Version="6.0.0" />
|
||||||
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||||
<PackageReference Include="System.Data.SqlClient" Version="4.8.5" />
|
<PackageReference Include="System.Data.SqlClient" Version="4.8.5" />
|
||||||
|
<PackageReference Include="System.Text.Json" Version="7.0.2" />
|
||||||
<PackageReference Include="ZXing.Net" Version="0.16.8" />
|
<PackageReference Include="ZXing.Net" Version="0.16.8" />
|
||||||
<FrameworkReference Include="Microsoft.WindowsDesktop.App" />
|
<FrameworkReference Include="Microsoft.WindowsDesktop.App" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
||||||
|
<Choose>
|
||||||
|
<When Condition=" '$(Configuration)'=='Debug' ">
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="CVRLIB">
|
||||||
|
<HintPath>..\..\VB.NET\CVRLIB\CVRLIB\bin\Debug\netstandard2.0\CVRLIB.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="CVRLIB-NF">
|
||||||
|
<HintPath>..\..\VB.NET\CVRLIB-NF\CVRLIB-NF\bin\Debug\CVRLIB-NF.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="HtmlFactory">
|
||||||
|
<HintPath>..\HtmlFactory\HtmlFactory\bin\Debug\netstandard2.0\HtmlFactory.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
</ItemGroup>
|
||||||
|
</When>
|
||||||
|
<When Condition=" '$(Configuration)'=='Release' ">
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="CVRLIB">
|
<Reference Include="CVRLIB">
|
||||||
<HintPath>..\..\VB.NET\CVRLIB\CVRLIB\bin\Release\netstandard2.0\CVRLIB.dll</HintPath>
|
<HintPath>..\..\VB.NET\CVRLIB\CVRLIB\bin\Release\netstandard2.0\CVRLIB.dll</HintPath>
|
||||||
@ -22,6 +41,11 @@
|
|||||||
<Reference Include="CVRLIB-NF">
|
<Reference Include="CVRLIB-NF">
|
||||||
<HintPath>..\..\VB.NET\CVRLIB-NF\CVRLIB-NF\bin\Release\CVRLIB-NF.dll</HintPath>
|
<HintPath>..\..\VB.NET\CVRLIB-NF\CVRLIB-NF\bin\Release\CVRLIB-NF.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="HtmlFactory">
|
||||||
|
<HintPath>..\HtmlFactory\HtmlFactory\bin\Release\netstandard2.0\HtmlFactory.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
</When>
|
||||||
|
</Choose>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user