-
Welcome
+
Welcome Webserver
Learn about building Web apps with ASP.NET Core.
diff --git a/Webhook 4docs/ProcessedInvoices.cs b/Webhook 4docs/ProcessedInvoices.cs
new file mode 100644
index 0000000..21f8575
--- /dev/null
+++ b/Webhook 4docs/ProcessedInvoices.cs
@@ -0,0 +1,12 @@
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.Text.Json.Serialization;
+
+public class ProcessedInvoices
+{
+ [Key]
+ public int InvoiceId { get; set; }
+ public DateTime DateTimeProcessed { get; set; }
+ public string? Status { get; set; }
+ public string? InvoicePath { get; set; }
+}
\ No newline at end of file
diff --git a/Webhook 4docs/Program.cs b/Webhook 4docs/Program.cs
index fc904d7..b0d9ae8 100644
--- a/Webhook 4docs/Program.cs
+++ b/Webhook 4docs/Program.cs
@@ -1,16 +1,69 @@
+using System.Data.OleDb;
+using System.Text;
+using System.Text.Json;
+using Download_Faturas;
+using Microsoft.AspNetCore.Http.Extensions;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Metadata.Internal;
+
namespace Webhook_4docs
{
public class Program
{
public static void Main(string[] args)
{
+ string IndexedFilename(string stub, string extension)
+ {
+ int ix = 0;
+ string? filename = null;
+
+ if (File.Exists(String.Format("{0}.{1}", stub, extension)))
+ {
+ do
+ {
+ ix++;
+ filename = String.Format("{0} ({1}).{2}", stub, ix, extension);
+ } while (File.Exists(filename));
+ }
+ else
+ {
+ filename = String.Format("{0}.{1}", stub, extension);
+ }
+ return filename;
+ }
+
var builder = WebApplication.CreateBuilder(args);
+ builder.Configuration.AddJsonFile("appsettings.json");
+
+ var connectionString = builder.Configuration.GetConnectionString("WebhookDbContext");
+ string? appFolder = builder.Configuration["PathBase"];
+
+ builder.Services.AddDbContext