diff --git a/Controllers/MenuController.cs b/Controllers/MenuController.cs new file mode 100644 index 0000000..54354b0 --- /dev/null +++ b/Controllers/MenuController.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +using Microsoft.AspNetCore.Mvc; + + +namespace dotnet_rpg.Controllers +{ + [ApiController] + [Route("api/[controller]")] + public class MenuController : Controller + { + private static List menus = new List//è mock!! + { + new Menu (), + new Menu {Id=1, AppName="nuovaAppname"} + }; + [HttpGet("GetuttiMenu")] + public ActionResult> Get() + { + return Ok(menus); + } + + [HttpGet("{id}")] + public ActionResult GetSingle(int id) + { + return Ok(menus.FirstOrDefault(c => c.Id == id)); + } + } +} diff --git a/Models/DbNames.cs b/Models/DbNames.cs new file mode 100644 index 0000000..bc4fcf6 --- /dev/null +++ b/Models/DbNames.cs @@ -0,0 +1,11 @@ +using System.Text.Json.Serialization; +namespace dotnet_rpg.Models +{ + [JsonConverter(typeof(JsonStringEnumConverter))] + public enum DbNames + { + ISO9000 = 1, + RiskManagement = 2, + Grc = 3 + } +} diff --git a/Models/Menu.cs b/Models/Menu.cs new file mode 100644 index 0000000..f2002e8 --- /dev/null +++ b/Models/Menu.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +namespace dotnet_rpg.Models +{ + public class Menu + { + public int Id { get; set; } + public string AppName { get; set; } = "nomedellapp"; + public string Logo { get; set; } = "stringalogo"; + //public List? Dbnames { get; set; } + // public DbNames class { get; set; } = DbNames.Grc; + // public string? Language { get; set; } + //public string? FullName { get; set; } + //public partial class ParmItem + //{ + // public string? Cod_APPL { get; set; } + + // public string? APP_NAME { get; set; } + //} + //public partial class MenuItem + //{ + // public int Id { get; set; } + // public object? ParentID { get; set; } + // public string? Title { get; set; } + // public string? Url { get; set; } + + }} diff --git a/dotnet-rpg.sln b/dotnet-rpg.sln new file mode 100644 index 0000000..a2cb3b3 --- /dev/null +++ b/dotnet-rpg.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33213.308 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-rpg", "dotnet-rpg.csproj", "{E65900E6-6838-49BC-B65A-E3CACC524524}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E65900E6-6838-49BC-B65A-E3CACC524524}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E65900E6-6838-49BC-B65A-E3CACC524524}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E65900E6-6838-49BC-B65A-E3CACC524524}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E65900E6-6838-49BC-B65A-E3CACC524524}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A6EE36CF-B917-47BB-91EE-C42A36833870} + EndGlobalSection +EndGlobal