diff --git a/Aps Single Page Anwendung/Controllers/WeatherForecastController.cs b/Aps Single Page Anwendung/Controllers/WeatherForecastController.cs deleted file mode 100644 index 78841ea..0000000 --- a/Aps Single Page Anwendung/Controllers/WeatherForecastController.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Aps_Single_Page_Anwendung.Controllers -{ - [ApiController] - [Route("[controller]")] - public class WeatherForecastController : ControllerBase - { - private static readonly string[] Summaries = new[] - { - "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" - }; - - private readonly ILogger _logger; - - public WeatherForecastController(ILogger logger) - { - _logger = logger; - } - - [HttpGet] - public IEnumerable Get() - { - var rng = new Random(); - return Enumerable.Range(1, 5).Select(index => new WeatherForecast - { - Date = DateTime.Now.AddDays(index), - TemperatureC = rng.Next(-20, 55), - Summary = Summaries[rng.Next(Summaries.Length)] - }) - .ToArray(); - } - } -} diff --git a/Aps Single Page Anwendung/appsettings.json b/Aps Single Page Anwendung/appsettings.json deleted file mode 100644 index ad75fee..0000000 --- a/Aps Single Page Anwendung/appsettings.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - }, -"AllowedHosts": "*" -} diff --git a/Aps Single Page Anwendung.sln b/Single_Page_Anwendung.sln similarity index 84% rename from Aps Single Page Anwendung.sln rename to Single_Page_Anwendung.sln index 4dba405..523b912 100644 --- a/Aps Single Page Anwendung.sln +++ b/Single_Page_Anwendung.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.1.32319.34 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aps Single Page Anwendung", "Aps Single Page Anwendung\Aps Single Page Anwendung.csproj", "{82B23342-82DE-47B8-8FDC-A9477C6897EC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Single_Page_Anwendung", "Single_Page_Anwendung\Single_Page_Anwendung.csproj", "{82B23342-82DE-47B8-8FDC-A9477C6897EC}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/Aps Single Page Anwendung/ClientApp/README.md b/Single_Page_Anwendung/ClientApp/README.md similarity index 100% rename from Aps Single Page Anwendung/ClientApp/README.md rename to Single_Page_Anwendung/ClientApp/README.md diff --git a/Aps Single Page Anwendung/ClientApp/angular.json b/Single_Page_Anwendung/ClientApp/angular.json similarity index 100% rename from Aps Single Page Anwendung/ClientApp/angular.json rename to Single_Page_Anwendung/ClientApp/angular.json diff --git a/Aps Single Page Anwendung/ClientApp/browserslist b/Single_Page_Anwendung/ClientApp/browserslist similarity index 100% rename from Aps Single Page Anwendung/ClientApp/browserslist rename to Single_Page_Anwendung/ClientApp/browserslist diff --git a/Aps Single Page Anwendung/ClientApp/e2e/protractor.conf.js b/Single_Page_Anwendung/ClientApp/e2e/protractor.conf.js similarity index 100% rename from Aps Single Page Anwendung/ClientApp/e2e/protractor.conf.js rename to Single_Page_Anwendung/ClientApp/e2e/protractor.conf.js diff --git a/Aps Single Page Anwendung/ClientApp/e2e/src/app.e2e-spec.ts b/Single_Page_Anwendung/ClientApp/e2e/src/app.e2e-spec.ts similarity index 100% rename from Aps Single Page Anwendung/ClientApp/e2e/src/app.e2e-spec.ts rename to Single_Page_Anwendung/ClientApp/e2e/src/app.e2e-spec.ts diff --git a/Aps Single Page Anwendung/ClientApp/e2e/src/app.po.ts b/Single_Page_Anwendung/ClientApp/e2e/src/app.po.ts similarity index 100% rename from Aps Single Page Anwendung/ClientApp/e2e/src/app.po.ts rename to Single_Page_Anwendung/ClientApp/e2e/src/app.po.ts diff --git a/Aps Single Page Anwendung/ClientApp/e2e/tsconfig.e2e.json b/Single_Page_Anwendung/ClientApp/e2e/tsconfig.e2e.json similarity index 100% rename from Aps Single Page Anwendung/ClientApp/e2e/tsconfig.e2e.json rename to Single_Page_Anwendung/ClientApp/e2e/tsconfig.e2e.json diff --git a/Aps Single Page Anwendung/ClientApp/package-lock.json b/Single_Page_Anwendung/ClientApp/package-lock.json similarity index 100% rename from Aps Single Page Anwendung/ClientApp/package-lock.json rename to Single_Page_Anwendung/ClientApp/package-lock.json diff --git a/Aps Single Page Anwendung/ClientApp/package.json b/Single_Page_Anwendung/ClientApp/package.json similarity index 100% rename from Aps Single Page Anwendung/ClientApp/package.json rename to Single_Page_Anwendung/ClientApp/package.json diff --git a/Aps Single Page Anwendung/ClientApp/src/app/app.component.html b/Single_Page_Anwendung/ClientApp/src/app/app.component.html similarity index 100% rename from Aps Single Page Anwendung/ClientApp/src/app/app.component.html rename to Single_Page_Anwendung/ClientApp/src/app/app.component.html diff --git a/Aps Single Page Anwendung/ClientApp/src/app/app.component.ts b/Single_Page_Anwendung/ClientApp/src/app/app.component.ts similarity index 100% rename from Aps Single Page Anwendung/ClientApp/src/app/app.component.ts rename to Single_Page_Anwendung/ClientApp/src/app/app.component.ts diff --git a/Aps Single Page Anwendung/ClientApp/src/app/app.module.ts b/Single_Page_Anwendung/ClientApp/src/app/app.module.ts similarity index 100% rename from Aps Single Page Anwendung/ClientApp/src/app/app.module.ts rename to Single_Page_Anwendung/ClientApp/src/app/app.module.ts diff --git a/Aps Single Page Anwendung/ClientApp/src/app/app.server.module.ts b/Single_Page_Anwendung/ClientApp/src/app/app.server.module.ts similarity index 100% rename from Aps Single Page Anwendung/ClientApp/src/app/app.server.module.ts rename to Single_Page_Anwendung/ClientApp/src/app/app.server.module.ts diff --git a/Aps Single Page Anwendung/ClientApp/src/app/counter/counter.component.html b/Single_Page_Anwendung/ClientApp/src/app/counter/counter.component.html similarity index 100% rename from Aps Single Page Anwendung/ClientApp/src/app/counter/counter.component.html rename to Single_Page_Anwendung/ClientApp/src/app/counter/counter.component.html diff --git a/Aps Single Page Anwendung/ClientApp/src/app/counter/counter.component.spec.ts b/Single_Page_Anwendung/ClientApp/src/app/counter/counter.component.spec.ts similarity index 100% rename from Aps Single Page Anwendung/ClientApp/src/app/counter/counter.component.spec.ts rename to Single_Page_Anwendung/ClientApp/src/app/counter/counter.component.spec.ts diff --git a/Aps Single Page Anwendung/ClientApp/src/app/counter/counter.component.ts b/Single_Page_Anwendung/ClientApp/src/app/counter/counter.component.ts similarity index 100% rename from Aps Single Page Anwendung/ClientApp/src/app/counter/counter.component.ts rename to Single_Page_Anwendung/ClientApp/src/app/counter/counter.component.ts diff --git a/Aps Single Page Anwendung/ClientApp/src/app/fetch-data/fetch-data.component.html b/Single_Page_Anwendung/ClientApp/src/app/fetch-data/fetch-data.component.html similarity index 100% rename from Aps Single Page Anwendung/ClientApp/src/app/fetch-data/fetch-data.component.html rename to Single_Page_Anwendung/ClientApp/src/app/fetch-data/fetch-data.component.html diff --git a/Aps Single Page Anwendung/ClientApp/src/app/fetch-data/fetch-data.component.ts b/Single_Page_Anwendung/ClientApp/src/app/fetch-data/fetch-data.component.ts similarity index 100% rename from Aps Single Page Anwendung/ClientApp/src/app/fetch-data/fetch-data.component.ts rename to Single_Page_Anwendung/ClientApp/src/app/fetch-data/fetch-data.component.ts diff --git a/Aps Single Page Anwendung/ClientApp/src/app/home/home.component.html b/Single_Page_Anwendung/ClientApp/src/app/home/home.component.html similarity index 100% rename from Aps Single Page Anwendung/ClientApp/src/app/home/home.component.html rename to Single_Page_Anwendung/ClientApp/src/app/home/home.component.html diff --git a/Aps Single Page Anwendung/ClientApp/src/app/home/home.component.ts b/Single_Page_Anwendung/ClientApp/src/app/home/home.component.ts similarity index 100% rename from Aps Single Page Anwendung/ClientApp/src/app/home/home.component.ts rename to Single_Page_Anwendung/ClientApp/src/app/home/home.component.ts diff --git a/Aps Single Page Anwendung/ClientApp/src/app/nav-menu/nav-menu.component.css b/Single_Page_Anwendung/ClientApp/src/app/nav-menu/nav-menu.component.css similarity index 100% rename from Aps Single Page Anwendung/ClientApp/src/app/nav-menu/nav-menu.component.css rename to Single_Page_Anwendung/ClientApp/src/app/nav-menu/nav-menu.component.css diff --git a/Aps Single Page Anwendung/ClientApp/src/app/nav-menu/nav-menu.component.html b/Single_Page_Anwendung/ClientApp/src/app/nav-menu/nav-menu.component.html similarity index 100% rename from Aps Single Page Anwendung/ClientApp/src/app/nav-menu/nav-menu.component.html rename to Single_Page_Anwendung/ClientApp/src/app/nav-menu/nav-menu.component.html diff --git a/Aps Single Page Anwendung/ClientApp/src/app/nav-menu/nav-menu.component.ts b/Single_Page_Anwendung/ClientApp/src/app/nav-menu/nav-menu.component.ts similarity index 100% rename from Aps Single Page Anwendung/ClientApp/src/app/nav-menu/nav-menu.component.ts rename to Single_Page_Anwendung/ClientApp/src/app/nav-menu/nav-menu.component.ts diff --git a/Aps Single Page Anwendung/ClientApp/src/environments/environment.prod.ts b/Single_Page_Anwendung/ClientApp/src/environments/environment.prod.ts similarity index 100% rename from Aps Single Page Anwendung/ClientApp/src/environments/environment.prod.ts rename to Single_Page_Anwendung/ClientApp/src/environments/environment.prod.ts diff --git a/Aps Single Page Anwendung/ClientApp/src/environments/environment.ts b/Single_Page_Anwendung/ClientApp/src/environments/environment.ts similarity index 100% rename from Aps Single Page Anwendung/ClientApp/src/environments/environment.ts rename to Single_Page_Anwendung/ClientApp/src/environments/environment.ts diff --git a/Aps Single Page Anwendung/ClientApp/src/index.html b/Single_Page_Anwendung/ClientApp/src/index.html similarity index 100% rename from Aps Single Page Anwendung/ClientApp/src/index.html rename to Single_Page_Anwendung/ClientApp/src/index.html diff --git a/Aps Single Page Anwendung/ClientApp/src/karma.conf.js b/Single_Page_Anwendung/ClientApp/src/karma.conf.js similarity index 100% rename from Aps Single Page Anwendung/ClientApp/src/karma.conf.js rename to Single_Page_Anwendung/ClientApp/src/karma.conf.js diff --git a/Aps Single Page Anwendung/ClientApp/src/main.ts b/Single_Page_Anwendung/ClientApp/src/main.ts similarity index 100% rename from Aps Single Page Anwendung/ClientApp/src/main.ts rename to Single_Page_Anwendung/ClientApp/src/main.ts diff --git a/Aps Single Page Anwendung/ClientApp/src/polyfills.ts b/Single_Page_Anwendung/ClientApp/src/polyfills.ts similarity index 100% rename from Aps Single Page Anwendung/ClientApp/src/polyfills.ts rename to Single_Page_Anwendung/ClientApp/src/polyfills.ts diff --git a/Aps Single Page Anwendung/ClientApp/src/styles.css b/Single_Page_Anwendung/ClientApp/src/styles.css similarity index 100% rename from Aps Single Page Anwendung/ClientApp/src/styles.css rename to Single_Page_Anwendung/ClientApp/src/styles.css diff --git a/Aps Single Page Anwendung/ClientApp/src/test.ts b/Single_Page_Anwendung/ClientApp/src/test.ts similarity index 100% rename from Aps Single Page Anwendung/ClientApp/src/test.ts rename to Single_Page_Anwendung/ClientApp/src/test.ts diff --git a/Aps Single Page Anwendung/ClientApp/src/tsconfig.app.json b/Single_Page_Anwendung/ClientApp/src/tsconfig.app.json similarity index 100% rename from Aps Single Page Anwendung/ClientApp/src/tsconfig.app.json rename to Single_Page_Anwendung/ClientApp/src/tsconfig.app.json diff --git a/Aps Single Page Anwendung/ClientApp/src/tsconfig.server.json b/Single_Page_Anwendung/ClientApp/src/tsconfig.server.json similarity index 100% rename from Aps Single Page Anwendung/ClientApp/src/tsconfig.server.json rename to Single_Page_Anwendung/ClientApp/src/tsconfig.server.json diff --git a/Aps Single Page Anwendung/ClientApp/src/tsconfig.spec.json b/Single_Page_Anwendung/ClientApp/src/tsconfig.spec.json similarity index 100% rename from Aps Single Page Anwendung/ClientApp/src/tsconfig.spec.json rename to Single_Page_Anwendung/ClientApp/src/tsconfig.spec.json diff --git a/Aps Single Page Anwendung/ClientApp/src/tslint.json b/Single_Page_Anwendung/ClientApp/src/tslint.json similarity index 100% rename from Aps Single Page Anwendung/ClientApp/src/tslint.json rename to Single_Page_Anwendung/ClientApp/src/tslint.json diff --git a/Aps Single Page Anwendung/ClientApp/tsconfig.json b/Single_Page_Anwendung/ClientApp/tsconfig.json similarity index 100% rename from Aps Single Page Anwendung/ClientApp/tsconfig.json rename to Single_Page_Anwendung/ClientApp/tsconfig.json diff --git a/Aps Single Page Anwendung/ClientApp/tslint.json b/Single_Page_Anwendung/ClientApp/tslint.json similarity index 100% rename from Aps Single Page Anwendung/ClientApp/tslint.json rename to Single_Page_Anwendung/ClientApp/tslint.json diff --git a/Aps Single Page Anwendung/Controllers/KategorienController.cs b/Single_Page_Anwendung/Controllers/KategorienController.cs similarity index 100% rename from Aps Single Page Anwendung/Controllers/KategorienController.cs rename to Single_Page_Anwendung/Controllers/KategorienController.cs diff --git a/Aps Single Page Anwendung/Controllers/SpeisenController.cs b/Single_Page_Anwendung/Controllers/SpeisenController.cs similarity index 100% rename from Aps Single Page Anwendung/Controllers/SpeisenController.cs rename to Single_Page_Anwendung/Controllers/SpeisenController.cs diff --git a/Single_Page_Anwendung/Migrations/20220607122417_InitialCreate.Designer.cs b/Single_Page_Anwendung/Migrations/20220607122417_InitialCreate.Designer.cs new file mode 100644 index 0000000..ea84dac --- /dev/null +++ b/Single_Page_Anwendung/Migrations/20220607122417_InitialCreate.Designer.cs @@ -0,0 +1,83 @@ +// +using Aps_Single_Page_Anwendung.Models; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +namespace Single_Page_Anwendung.Migrations +{ + [DbContext(typeof(FutterContext))] + [Migration("20220607122417_InitialCreate")] + partial class InitialCreate + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Aps_Single_Page_Anwendung.Models.Kategorie", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Beschreibung") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("Name") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.HasKey("Id"); + + b.ToTable("Kategorien"); + }); + + modelBuilder.Entity("Aps_Single_Page_Anwendung.Models.Speise", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Beschreibung") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("KategorieId") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("Preis") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.HasIndex("KategorieId"); + + b.ToTable("Speisen"); + }); + + modelBuilder.Entity("Aps_Single_Page_Anwendung.Models.Speise", b => + { + b.HasOne("Aps_Single_Page_Anwendung.Models.Kategorie", "Kategorie") + .WithMany("Speisen") + .HasForeignKey("KategorieId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Single_Page_Anwendung/Migrations/20220607122417_InitialCreate.cs b/Single_Page_Anwendung/Migrations/20220607122417_InitialCreate.cs new file mode 100644 index 0000000..d29ddf1 --- /dev/null +++ b/Single_Page_Anwendung/Migrations/20220607122417_InitialCreate.cs @@ -0,0 +1,60 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Single_Page_Anwendung.Migrations +{ + public partial class InitialCreate : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Kategorien", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(maxLength: 100, nullable: true), + Beschreibung = table.Column(maxLength: 255, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Kategorien", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Speisen", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(maxLength: 100, nullable: false), + Beschreibung = table.Column(maxLength: 255, nullable: true), + Preis = table.Column(nullable: false), + KategorieId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Speisen", x => x.Id); + table.ForeignKey( + name: "FK_Speisen_Kategorien_KategorieId", + column: x => x.KategorieId, + principalTable: "Kategorien", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_Speisen_KategorieId", + table: "Speisen", + column: "KategorieId"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Speisen"); + + migrationBuilder.DropTable( + name: "Kategorien"); + } + } +} diff --git a/Single_Page_Anwendung/Migrations/FutterContextModelSnapshot.cs b/Single_Page_Anwendung/Migrations/FutterContextModelSnapshot.cs new file mode 100644 index 0000000..bbd8791 --- /dev/null +++ b/Single_Page_Anwendung/Migrations/FutterContextModelSnapshot.cs @@ -0,0 +1,81 @@ +// +using Aps_Single_Page_Anwendung.Models; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +namespace Single_Page_Anwendung.Migrations +{ + [DbContext(typeof(FutterContext))] + partial class FutterContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Aps_Single_Page_Anwendung.Models.Kategorie", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Beschreibung") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("Name") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.HasKey("Id"); + + b.ToTable("Kategorien"); + }); + + modelBuilder.Entity("Aps_Single_Page_Anwendung.Models.Speise", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Beschreibung") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("KategorieId") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("Preis") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.HasIndex("KategorieId"); + + b.ToTable("Speisen"); + }); + + modelBuilder.Entity("Aps_Single_Page_Anwendung.Models.Speise", b => + { + b.HasOne("Aps_Single_Page_Anwendung.Models.Kategorie", "Kategorie") + .WithMany("Speisen") + .HasForeignKey("KategorieId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Single_Page_Anwendung/Models/DatenEinlesen.cs b/Single_Page_Anwendung/Models/DatenEinlesen.cs new file mode 100644 index 0000000..5d39866 --- /dev/null +++ b/Single_Page_Anwendung/Models/DatenEinlesen.cs @@ -0,0 +1,6 @@ +namespace Single_Page_Anwendung.Models +{ + public class DatenEinlesen + { + } +} diff --git a/Single_Page_Anwendung/Models/FutterContext.cs b/Single_Page_Anwendung/Models/FutterContext.cs new file mode 100644 index 0000000..41e599e --- /dev/null +++ b/Single_Page_Anwendung/Models/FutterContext.cs @@ -0,0 +1,21 @@ +using Microsoft.EntityFrameworkCore; + +namespace Aps_Single_Page_Anwendung.Models +{ + public class FutterContext : DbContext + { + public FutterContext(DbContextOptions options) : base(options) + { + + } + + //Erzeugt eine Tabelle namens Speisen mit den Felder aus Speise (Models) + public DbSet Speisen { get; set; } + + //Erzeugt eine Tabelle namens Kategorien, mit den Feldern aus Kategorie (Models) + public DbSet Kategorien { get; set; } + } + + + +} diff --git a/Aps Single Page Anwendung/Models/Kategorie.cs b/Single_Page_Anwendung/Models/Kategorie.cs similarity index 76% rename from Aps Single Page Anwendung/Models/Kategorie.cs rename to Single_Page_Anwendung/Models/Kategorie.cs index 621f0b8..bdf55cb 100644 --- a/Aps Single Page Anwendung/Models/Kategorie.cs +++ b/Single_Page_Anwendung/Models/Kategorie.cs @@ -1,11 +1,17 @@ using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; namespace Aps_Single_Page_Anwendung.Models { public class Kategorie { + public int Id { get; set; } + + [MaxLength(100)] public string Name { get; set; } + + [MaxLength(255)] public string Beschreibung { get; set; } public virtual ICollection Speisen { get; set; } = new HashSet(); } diff --git a/Aps Single Page Anwendung/Models/Speise.cs b/Single_Page_Anwendung/Models/Speise.cs similarity index 70% rename from Aps Single Page Anwendung/Models/Speise.cs rename to Single_Page_Anwendung/Models/Speise.cs index 2325964..cacd65c 100644 --- a/Aps Single Page Anwendung/Models/Speise.cs +++ b/Single_Page_Anwendung/Models/Speise.cs @@ -6,8 +6,11 @@ namespace Aps_Single_Page_Anwendung.Models { public int Id { get; set; } - [Required] // Leere Felder sind damit nicht möglich + [Required] // Leere Felder sind damit nicht möglich, kein null möglich + [MaxLength(100)] // Vermeidet bei des Feldes in der Tabelle ein varchar(Max) public string Name { get; set; } + + [MaxLength(255)] public string Beschreibung { get; set; } [Range(0,25)] // Preis darf nur zwischen 0 und 25 Euro sein diff --git a/Aps Single Page Anwendung/Pages/Error.cshtml b/Single_Page_Anwendung/Pages/Error.cshtml similarity index 100% rename from Aps Single Page Anwendung/Pages/Error.cshtml rename to Single_Page_Anwendung/Pages/Error.cshtml diff --git a/Aps Single Page Anwendung/Pages/Error.cshtml.cs b/Single_Page_Anwendung/Pages/Error.cshtml.cs similarity index 100% rename from Aps Single Page Anwendung/Pages/Error.cshtml.cs rename to Single_Page_Anwendung/Pages/Error.cshtml.cs diff --git a/Aps Single Page Anwendung/Pages/_ViewImports.cshtml b/Single_Page_Anwendung/Pages/_ViewImports.cshtml similarity index 100% rename from Aps Single Page Anwendung/Pages/_ViewImports.cshtml rename to Single_Page_Anwendung/Pages/_ViewImports.cshtml diff --git a/Aps Single Page Anwendung/Program.cs b/Single_Page_Anwendung/Program.cs similarity index 100% rename from Aps Single Page Anwendung/Program.cs rename to Single_Page_Anwendung/Program.cs diff --git a/Aps Single Page Anwendung/Properties/launchSettings.json b/Single_Page_Anwendung/Properties/launchSettings.json similarity index 100% rename from Aps Single Page Anwendung/Properties/launchSettings.json rename to Single_Page_Anwendung/Properties/launchSettings.json diff --git a/Aps Single Page Anwendung/Repositories/FileKategorieRepository.cs b/Single_Page_Anwendung/Repositories/FileKategorieRepository.cs similarity index 100% rename from Aps Single Page Anwendung/Repositories/FileKategorieRepository.cs rename to Single_Page_Anwendung/Repositories/FileKategorieRepository.cs diff --git a/Aps Single Page Anwendung/Repositories/FileSpeiseRepository.cs b/Single_Page_Anwendung/Repositories/FileSpeiseRepository.cs similarity index 100% rename from Aps Single Page Anwendung/Repositories/FileSpeiseRepository.cs rename to Single_Page_Anwendung/Repositories/FileSpeiseRepository.cs diff --git a/Aps Single Page Anwendung/Repositories/IKategorieRepository.cs b/Single_Page_Anwendung/Repositories/IKategorieRepository.cs similarity index 100% rename from Aps Single Page Anwendung/Repositories/IKategorieRepository.cs rename to Single_Page_Anwendung/Repositories/IKategorieRepository.cs diff --git a/Aps Single Page Anwendung/Repositories/ISpeiseRepository.cs b/Single_Page_Anwendung/Repositories/ISpeiseRepository.cs similarity index 100% rename from Aps Single Page Anwendung/Repositories/ISpeiseRepository.cs rename to Single_Page_Anwendung/Repositories/ISpeiseRepository.cs diff --git a/Aps Single Page Anwendung/Aps Single Page Anwendung.csproj b/Single_Page_Anwendung/Single_Page_Anwendung.csproj similarity index 87% rename from Aps Single Page Anwendung/Aps Single Page Anwendung.csproj rename to Single_Page_Anwendung/Single_Page_Anwendung.csproj index 793098b..aa03ca3 100644 --- a/Aps Single Page Anwendung/Aps Single Page Anwendung.csproj +++ b/Single_Page_Anwendung/Single_Page_Anwendung.csproj @@ -10,11 +10,16 @@ false - Aps_Single_Page_Anwendung + Single_Page_Anwendung + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + diff --git a/Aps Single Page Anwendung/Startup.cs b/Single_Page_Anwendung/Startup.cs similarity index 90% rename from Aps Single Page Anwendung/Startup.cs rename to Single_Page_Anwendung/Startup.cs index da06a73..eba8989 100644 --- a/Aps Single Page Anwendung/Startup.cs +++ b/Single_Page_Anwendung/Startup.cs @@ -1,8 +1,10 @@ +using Aps_Single_Page_Anwendung.Models; using Aps_Single_Page_Anwendung.Repositories; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.HttpsPolicy; using Microsoft.AspNetCore.SpaServices.AngularCli; +using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; @@ -18,9 +20,12 @@ namespace Aps_Single_Page_Anwendung public IConfiguration Configuration { get; } - // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { + // Connection String den ich in der appsettings.json definiert habe + services.AddDbContext(options => options.UseSqlServer(Configuration.GetConnectionString("FutterContext"))); + + services.AddControllersWithViews(); // Sorgt dafür, das jedesmal wenn ein ISpeiseRep angefragt wird, wird ein FileSpeiseRep zurückgegeben diff --git a/Aps Single Page Anwendung/WeatherForecast.cs b/Single_Page_Anwendung/WeatherForecast.cs similarity index 100% rename from Aps Single Page Anwendung/WeatherForecast.cs rename to Single_Page_Anwendung/WeatherForecast.cs diff --git a/Aps Single Page Anwendung/appsettings.Development.json b/Single_Page_Anwendung/appsettings.Development.json similarity index 100% rename from Aps Single Page Anwendung/appsettings.Development.json rename to Single_Page_Anwendung/appsettings.Development.json diff --git a/Single_Page_Anwendung/appsettings.json b/Single_Page_Anwendung/appsettings.json new file mode 100644 index 0000000..6fa11df --- /dev/null +++ b/Single_Page_Anwendung/appsettings.json @@ -0,0 +1,13 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "ConnectionStrings": { + "FutterContext" : "Server=(localdb)\\mssqllocaldb;Database=DaRestaurant;Trusted_Connection=True;MultipleActiveResultSets=True" // Verbindungsstring zur Datenbank, in diesem Fall Local + }, +"AllowedHosts": "*" +} diff --git a/Aps Single Page Anwendung/data/images/kategorie/1.jpg b/Single_Page_Anwendung/data/images/kategorie/1.jpg similarity index 100% rename from Aps Single Page Anwendung/data/images/kategorie/1.jpg rename to Single_Page_Anwendung/data/images/kategorie/1.jpg diff --git a/Aps Single Page Anwendung/data/images/kategorie/2.jpg b/Single_Page_Anwendung/data/images/kategorie/2.jpg similarity index 100% rename from Aps Single Page Anwendung/data/images/kategorie/2.jpg rename to Single_Page_Anwendung/data/images/kategorie/2.jpg diff --git a/Aps Single Page Anwendung/data/images/kategorie/3.jpg b/Single_Page_Anwendung/data/images/kategorie/3.jpg similarity index 100% rename from Aps Single Page Anwendung/data/images/kategorie/3.jpg rename to Single_Page_Anwendung/data/images/kategorie/3.jpg diff --git a/Aps Single Page Anwendung/data/images/kategorie/4.jpg b/Single_Page_Anwendung/data/images/kategorie/4.jpg similarity index 100% rename from Aps Single Page Anwendung/data/images/kategorie/4.jpg rename to Single_Page_Anwendung/data/images/kategorie/4.jpg diff --git a/Aps Single Page Anwendung/data/images/kategorie/5.jpg b/Single_Page_Anwendung/data/images/kategorie/5.jpg similarity index 100% rename from Aps Single Page Anwendung/data/images/kategorie/5.jpg rename to Single_Page_Anwendung/data/images/kategorie/5.jpg diff --git a/Aps Single Page Anwendung/data/images/kategorie/6.jpg b/Single_Page_Anwendung/data/images/kategorie/6.jpg similarity index 100% rename from Aps Single Page Anwendung/data/images/kategorie/6.jpg rename to Single_Page_Anwendung/data/images/kategorie/6.jpg diff --git a/Aps Single Page Anwendung/data/images/kategorie/credits.txt b/Single_Page_Anwendung/data/images/kategorie/credits.txt similarity index 100% rename from Aps Single Page Anwendung/data/images/kategorie/credits.txt rename to Single_Page_Anwendung/data/images/kategorie/credits.txt diff --git a/Aps Single Page Anwendung/data/images/kategorie/license.md b/Single_Page_Anwendung/data/images/kategorie/license.md similarity index 100% rename from Aps Single Page Anwendung/data/images/kategorie/license.md rename to Single_Page_Anwendung/data/images/kategorie/license.md diff --git a/Aps Single Page Anwendung/data/images/speisen/1.jpg b/Single_Page_Anwendung/data/images/speisen/1.jpg similarity index 100% rename from Aps Single Page Anwendung/data/images/speisen/1.jpg rename to Single_Page_Anwendung/data/images/speisen/1.jpg diff --git a/Aps Single Page Anwendung/data/images/speisen/10.jpg b/Single_Page_Anwendung/data/images/speisen/10.jpg similarity index 100% rename from Aps Single Page Anwendung/data/images/speisen/10.jpg rename to Single_Page_Anwendung/data/images/speisen/10.jpg diff --git a/Aps Single Page Anwendung/data/images/speisen/11.jpg b/Single_Page_Anwendung/data/images/speisen/11.jpg similarity index 100% rename from Aps Single Page Anwendung/data/images/speisen/11.jpg rename to Single_Page_Anwendung/data/images/speisen/11.jpg diff --git a/Aps Single Page Anwendung/data/images/speisen/12.jpg b/Single_Page_Anwendung/data/images/speisen/12.jpg similarity index 100% rename from Aps Single Page Anwendung/data/images/speisen/12.jpg rename to Single_Page_Anwendung/data/images/speisen/12.jpg diff --git a/Aps Single Page Anwendung/data/images/speisen/13.jpg b/Single_Page_Anwendung/data/images/speisen/13.jpg similarity index 100% rename from Aps Single Page Anwendung/data/images/speisen/13.jpg rename to Single_Page_Anwendung/data/images/speisen/13.jpg diff --git a/Aps Single Page Anwendung/data/images/speisen/14.jpg b/Single_Page_Anwendung/data/images/speisen/14.jpg similarity index 100% rename from Aps Single Page Anwendung/data/images/speisen/14.jpg rename to Single_Page_Anwendung/data/images/speisen/14.jpg diff --git a/Aps Single Page Anwendung/data/images/speisen/15.jpg b/Single_Page_Anwendung/data/images/speisen/15.jpg similarity index 100% rename from Aps Single Page Anwendung/data/images/speisen/15.jpg rename to Single_Page_Anwendung/data/images/speisen/15.jpg diff --git a/Aps Single Page Anwendung/data/images/speisen/16.jpg b/Single_Page_Anwendung/data/images/speisen/16.jpg similarity index 100% rename from Aps Single Page Anwendung/data/images/speisen/16.jpg rename to Single_Page_Anwendung/data/images/speisen/16.jpg diff --git a/Aps Single Page Anwendung/data/images/speisen/17.jpg b/Single_Page_Anwendung/data/images/speisen/17.jpg similarity index 100% rename from Aps Single Page Anwendung/data/images/speisen/17.jpg rename to Single_Page_Anwendung/data/images/speisen/17.jpg diff --git a/Aps Single Page Anwendung/data/images/speisen/18.jpg b/Single_Page_Anwendung/data/images/speisen/18.jpg similarity index 100% rename from Aps Single Page Anwendung/data/images/speisen/18.jpg rename to Single_Page_Anwendung/data/images/speisen/18.jpg diff --git a/Aps Single Page Anwendung/data/images/speisen/19.jpg b/Single_Page_Anwendung/data/images/speisen/19.jpg similarity index 100% rename from Aps Single Page Anwendung/data/images/speisen/19.jpg rename to Single_Page_Anwendung/data/images/speisen/19.jpg diff --git a/Aps Single Page Anwendung/data/images/speisen/2.jpg b/Single_Page_Anwendung/data/images/speisen/2.jpg similarity index 100% rename from Aps Single Page Anwendung/data/images/speisen/2.jpg rename to Single_Page_Anwendung/data/images/speisen/2.jpg diff --git a/Aps Single Page Anwendung/data/images/speisen/20.jpg b/Single_Page_Anwendung/data/images/speisen/20.jpg similarity index 100% rename from Aps Single Page Anwendung/data/images/speisen/20.jpg rename to Single_Page_Anwendung/data/images/speisen/20.jpg diff --git a/Aps Single Page Anwendung/data/images/speisen/21.jpg b/Single_Page_Anwendung/data/images/speisen/21.jpg similarity index 100% rename from Aps Single Page Anwendung/data/images/speisen/21.jpg rename to Single_Page_Anwendung/data/images/speisen/21.jpg diff --git a/Aps Single Page Anwendung/data/images/speisen/22.jpg b/Single_Page_Anwendung/data/images/speisen/22.jpg similarity index 100% rename from Aps Single Page Anwendung/data/images/speisen/22.jpg rename to Single_Page_Anwendung/data/images/speisen/22.jpg diff --git a/Aps Single Page Anwendung/data/images/speisen/3.jpg b/Single_Page_Anwendung/data/images/speisen/3.jpg similarity index 100% rename from Aps Single Page Anwendung/data/images/speisen/3.jpg rename to Single_Page_Anwendung/data/images/speisen/3.jpg diff --git a/Aps Single Page Anwendung/data/images/speisen/4.jpg b/Single_Page_Anwendung/data/images/speisen/4.jpg similarity index 100% rename from Aps Single Page Anwendung/data/images/speisen/4.jpg rename to Single_Page_Anwendung/data/images/speisen/4.jpg diff --git a/Aps Single Page Anwendung/data/images/speisen/5.jpg b/Single_Page_Anwendung/data/images/speisen/5.jpg similarity index 100% rename from Aps Single Page Anwendung/data/images/speisen/5.jpg rename to Single_Page_Anwendung/data/images/speisen/5.jpg diff --git a/Aps Single Page Anwendung/data/images/speisen/6.jpg b/Single_Page_Anwendung/data/images/speisen/6.jpg similarity index 100% rename from Aps Single Page Anwendung/data/images/speisen/6.jpg rename to Single_Page_Anwendung/data/images/speisen/6.jpg diff --git a/Aps Single Page Anwendung/data/images/speisen/7.jpg b/Single_Page_Anwendung/data/images/speisen/7.jpg similarity index 100% rename from Aps Single Page Anwendung/data/images/speisen/7.jpg rename to Single_Page_Anwendung/data/images/speisen/7.jpg diff --git a/Aps Single Page Anwendung/data/images/speisen/8.jpg b/Single_Page_Anwendung/data/images/speisen/8.jpg similarity index 100% rename from Aps Single Page Anwendung/data/images/speisen/8.jpg rename to Single_Page_Anwendung/data/images/speisen/8.jpg diff --git a/Aps Single Page Anwendung/data/images/speisen/9.jpg b/Single_Page_Anwendung/data/images/speisen/9.jpg similarity index 100% rename from Aps Single Page Anwendung/data/images/speisen/9.jpg rename to Single_Page_Anwendung/data/images/speisen/9.jpg diff --git a/Aps Single Page Anwendung/data/images/speisen/credits.txt b/Single_Page_Anwendung/data/images/speisen/credits.txt similarity index 100% rename from Aps Single Page Anwendung/data/images/speisen/credits.txt rename to Single_Page_Anwendung/data/images/speisen/credits.txt diff --git a/Aps Single Page Anwendung/data/images/speisen/license.md b/Single_Page_Anwendung/data/images/speisen/license.md similarity index 100% rename from Aps Single Page Anwendung/data/images/speisen/license.md rename to Single_Page_Anwendung/data/images/speisen/license.md diff --git a/Aps Single Page Anwendung/data/kategorie.json b/Single_Page_Anwendung/data/kategorie.json similarity index 100% rename from Aps Single Page Anwendung/data/kategorie.json rename to Single_Page_Anwendung/data/kategorie.json diff --git a/Aps Single Page Anwendung/data/speisen.json b/Single_Page_Anwendung/data/speisen.json similarity index 100% rename from Aps Single Page Anwendung/data/speisen.json rename to Single_Page_Anwendung/data/speisen.json diff --git a/Aps Single Page Anwendung/wwwroot/favicon.ico b/Single_Page_Anwendung/wwwroot/favicon.ico similarity index 100% rename from Aps Single Page Anwendung/wwwroot/favicon.ico rename to Single_Page_Anwendung/wwwroot/favicon.ico