add competition Image to Database

This commit is contained in:
Natlinux81
2022-08-28 19:03:24 +02:00
parent dfe0f72d04
commit bbf1e21fdf
13 changed files with 130 additions and 13 deletions

View File

@@ -28,7 +28,8 @@ namespace Apollon.EntityFramework.Commands
Id = tournament.Id,
Organisation = tournament.Organisation,
TournamentName = tournament.TournamentName,
Competition = tournament.Competition,
Competition = tournament.Competition,
CompetitionImage = tournament.CompetitionImage,
StartDate = tournament.StartDate,
EndDate = tournament.EndDate,
Location = tournament.Location,

View File

@@ -28,6 +28,7 @@ namespace Apollon.EntityFramework.Commands
Organisation = tournament.Organisation,
TournamentName = tournament.TournamentName,
Competition = tournament.Competition,
CompetitionImage = tournament.CompetitionImage,
StartDate = tournament.StartDate,
EndDate = tournament.EndDate,
Location = tournament.Location,

View File

@@ -12,6 +12,7 @@ namespace Apollon.EntityFramework.DTOs
public string Organisation { get; set; }
public string TournamentName { get; set; }
public string Competition { get; set; }
public string CompetitionImage { get; set; }
public DateTime StartDate { get; set; }
public DateTime EndDate { get; set; }
public string Location { get; set; }

View File

@@ -0,0 +1,64 @@
// <auto-generated />
using System;
using Apollon.EntityFramework;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Apollon.EntityFramework.Migrations
{
[DbContext(typeof(TournamentsDbContext))]
[Migration("20220828165744_initial1")]
partial class initial1
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "6.0.8")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
modelBuilder.Entity("Apollon.EntityFramework.DTOs.TournamentDto", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Competition")
.HasColumnType("nvarchar(max)");
b.Property<string>("CompetitionImage")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("EndDate")
.HasColumnType("datetime2");
b.Property<string>("Location")
.HasColumnType("nvarchar(max)");
b.Property<string>("Organisation")
.HasColumnType("nvarchar(max)");
b.Property<int>("Rounds")
.HasColumnType("int");
b.Property<DateTime>("StartDate")
.HasColumnType("datetime2");
b.Property<string>("TournamentName")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Tournaments");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,25 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Apollon.EntityFramework.Migrations
{
public partial class initial1 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "CompetitionImage",
table: "Tournaments",
type: "nvarchar(max)",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CompetitionImage",
table: "Tournaments");
}
}
}

View File

@@ -31,6 +31,9 @@ namespace Apollon.EntityFramework.Migrations
b.Property<string>("Competition")
.HasColumnType("nvarchar(max)");
b.Property<string>("CompetitionImage")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("EndDate")
.HasColumnType("datetime2");

View File

@@ -30,6 +30,7 @@ namespace Apollon.EntityFramework.Queries
y.Organisation,
y.TournamentName,
y.Competition,
y.CompetitionImage,
y.StartDate,
y.EndDate,
y.Location,