diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..48c6589
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,215 @@
+
+# User-specific files
+*.suo
+*.user
+*.sln.docstates
+
+# Build results
+[Dd]ebug/
+[Rr]elease/
+x64/
+[Bb]in/
+[Oo]bj/
+# build folder is nowadays used for build scripts and should not be ignored
+#build/
+
+# NuGet Packages
+*.nupkg
+# The packages folder can be ignored because of Package Restore
+**/packages/*
+# except build/, which is used as an MSBuild target.
+!**/packages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/packages/repositories.config
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+*_i.c
+*_p.c
+*.ilk
+*.meta
+*.obj
+*.pch
+*.pdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.scc
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opensdf
+*.sdf
+*.cachefile
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# NCrunch
+*.ncrunch*
+.*crunch*.local.xml
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+\!publish/
+
+# Publish Web Output
+*.Publish.xml
+
+# Windows Azure Build Output
+csx
+*.build.csdef
+
+# Windows Store app package directory
+AppPackages/
+
+# Others
+*.Cache
+ClientBin/
+[Ss]tyle[Cc]op.*
+~$*
+*~
+*.dbmdl
+*.[Pp]ublish.xml
+*.pfx
+*.publishsettings
+modulesbin/
+tempbin/
+
+# EPiServer Site file (VPP)
+AppData/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file to a newer
+# Visual Studio version. Backup files are not needed, because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+
+# vim
+*.txt~
+*.swp
+*.swo
+
+# Temp files when opening LibreOffice on ubuntu
+.~lock.*
+
+# svn
+.svn
+
+# CVS - Source Control
+**/CVS/
+
+# Remainings from resolving conflicts in Source Control
+*.orig
+
+# SQL Server files
+**/App_Data/*.mdf
+**/App_Data/*.ldf
+**/App_Data/*.sdf
+
+
+#LightSwitch generated files
+GeneratedArtifacts/
+_Pvt_Extensions/
+ModelManifest.xml
+
+# =========================
+# Windows detritus
+# =========================
+
+# Windows image file caches
+Thumbs.db
+ehthumbs.db
+
+# Folder config file
+Desktop.ini
+
+# Recycle Bin used on file shares
+$RECYCLE.BIN/
+
+# OS generated files #
+Icon?
+
+# Mac desktop service store files
+.DS_Store
+
+# SASS Compiler cache
+.sass-cache
+
+# Visual Studio 2014 CTP
+**/*.sln.ide
+
+# Visual Studio temp something
+.vs/
+
+# dotnet stuff
+project.lock.json
+
+# VS 2015+
+*.vc.vc.opendb
+*.vc.db
+
+# Rider
+.idea/
+
+# Visual Studio Code
+.vscode/
+
+# Output folder used by Webpack or other FE stuff
+**/node_modules/*
+**/wwwroot/*
+
+# SpecFlow specific
+*.feature.cs
+*.feature.xlsx.*
+*.Specs_*.html
+
+# UWP Projects
+AppPackages/
diff --git a/APICycleVDP.sln b/APICycleVDP.sln
index 2329781..1f0e449 100644
--- a/APICycleVDP.sln
+++ b/APICycleVDP.sln
@@ -5,8 +5,6 @@ VisualStudioVersion = 17.11.35303.130
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "APICycleVDP", "APICycleVDP\APICycleVDP.csproj", "{EE827F72-C902-4E67-B4E7-A1B869310349}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GenCycleVDP", "GenCycleVDP\GenCycleVDP.csproj", "{CEFFBDBE-DDBA-421D-80FA-A730914A5BDD}"
-EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -17,10 +15,6 @@ Global
{EE827F72-C902-4E67-B4E7-A1B869310349}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EE827F72-C902-4E67-B4E7-A1B869310349}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EE827F72-C902-4E67-B4E7-A1B869310349}.Release|Any CPU.Build.0 = Release|Any CPU
- {CEFFBDBE-DDBA-421D-80FA-A730914A5BDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {CEFFBDBE-DDBA-421D-80FA-A730914A5BDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {CEFFBDBE-DDBA-421D-80FA-A730914A5BDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {CEFFBDBE-DDBA-421D-80FA-A730914A5BDD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/APICycleVDP/.config/dotnet-tools.json b/APICycleVDP/.config/dotnet-tools.json
new file mode 100644
index 0000000..9fab42f
--- /dev/null
+++ b/APICycleVDP/.config/dotnet-tools.json
@@ -0,0 +1,13 @@
+{
+ "version": 1,
+ "isRoot": true,
+ "tools": {
+ "dotnet-ef": {
+ "version": "8.0.8",
+ "commands": [
+ "dotnet-ef"
+ ],
+ "rollForward": false
+ }
+ }
+}
\ No newline at end of file
diff --git a/APICycleVDP/APICycleVDP.csproj b/APICycleVDP/APICycleVDP.csproj
index 64687dd..d9f14f0 100644
--- a/APICycleVDP/APICycleVDP.csproj
+++ b/APICycleVDP/APICycleVDP.csproj
@@ -3,17 +3,13 @@
net8.0
enable
- enable
+ disable
-
-
-
-
-
-
+
+
diff --git a/APICycleVDP/Controller/CyclesController.cs b/APICycleVDP/Controller/CyclesController.cs
deleted file mode 100644
index cdc7db2..0000000
--- a/APICycleVDP/Controller/CyclesController.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-using Microsoft.AspNetCore.Cors;
-using Microsoft.AspNetCore.Mvc;
-using Newtonsoft.Json.Linq;
-using DbCycleVDP;
-
-namespace APICycleVDP.Controller
-{
- [EnableCors("All")]
- public class CyclesController : ControllerBase
- {
- [HttpPost]
- public ActionResult CurrCycles()
- {
- var result = new JObject
- {
- ["currTime"] = DateTime.Now
- };
-
- var tasks = new List>();
- //var v = new DB.WorkDB();
- for (var i = 1; i <= 48; i++)
- tasks.Add(WorkDB.GetCycle(i));
-
- var arr = new JArray();
- for (var i = 0; i < tasks.Count; i++)
- {
- var tmp = tasks[i].GetAwaiter().GetResult();
- if (tmp != null)
- {
- var t = new JObject();
- t["vdp"] = tmp.NumVdp;
- t["cycle"] = tmp.NumCycle;
- t["factStart"] = tmp.FactStart;
- t["factEnd"] = tmp.FactEnd;
- t["thinkEnd"] = tmp.ThinkEnd;
- arr.Add(t);
- }
- }
- result["data"] = arr;
-
- return Content(result.ToString(), "application/json");
- }
- }
-
-
- public static class WorkDB
- {
- async public static Task GetCycle(int vdp)
- {
- var result = new TableCycle();
- await Task.Run(() =>
- {
- try
- {
- using var db = new DbFurnace();
- var tmp = (from u in db.Cycles
- where
- u.NumVdp == vdp
- orderby u.FactStart descending
- select u).FirstOrDefault();
- result = tmp;
- }
- catch (Exception e)
- {
- Console.WriteLine(e.Message);
- }
- });
- return result;
- }
- }
-}
diff --git a/APICycleVDP/Controllers/CyclesController.cs b/APICycleVDP/Controllers/CyclesController.cs
new file mode 100644
index 0000000..20278d2
--- /dev/null
+++ b/APICycleVDP/Controllers/CyclesController.cs
@@ -0,0 +1,48 @@
+using Microsoft.AspNetCore.Mvc;
+using System;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.EntityFrameworkCore;
+using APICycleVDP.DB;
+
+namespace APICycleVDP.Controllers
+{
+ [ApiController]
+ [Route("cycles")]
+ public class CyclesController(DbVdpContext context) : ControllerBase
+ {
+ private readonly DbVdpContext _context = context;
+
+ [HttpPost("current")]
+ public async Task CurrCycles()
+ {
+ var result = new
+ {
+ currTime = DateTime.UtcNow,
+ data = new List