From d8b81f756664329b76e30dd521f282c320a1129a Mon Sep 17 00:00:00 2001 From: tleodev Date: Thu, 6 Feb 2025 09:11:42 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20Fix=20mapper=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20250109081041_Initialize.Designer.cs | 111 ---------- .../Migrations/20250109081041_Initialize.cs | 66 ------ ...20250109094119_TrainingProgram.Designer.cs | 191 ----------------- .../20250109094119_TrainingProgram.cs | 94 --------- .../20250109094527_Second.Designer.cs | 117 ----------- .../Migrations/20250109094527_Second.cs | 75 ------- .../OptifitDbContextModelSnapshot.cs | 194 ------------------ Server/FirstTest.db | Bin 61440 -> 0 bytes Server/Mappers/TrainingProgramProfile.cs | 24 ++- 9 files changed, 15 insertions(+), 857 deletions(-) delete mode 100644 Infrastructure/Migrations/20250109081041_Initialize.Designer.cs delete mode 100644 Infrastructure/Migrations/20250109081041_Initialize.cs delete mode 100644 Infrastructure/Migrations/20250109094119_TrainingProgram.Designer.cs delete mode 100644 Infrastructure/Migrations/20250109094119_TrainingProgram.cs delete mode 100644 Infrastructure/Migrations/20250109094527_Second.Designer.cs delete mode 100644 Infrastructure/Migrations/20250109094527_Second.cs delete mode 100644 Infrastructure/Migrations/OptifitDbContextModelSnapshot.cs delete mode 100644 Server/FirstTest.db diff --git a/Infrastructure/Migrations/20250109081041_Initialize.Designer.cs b/Infrastructure/Migrations/20250109081041_Initialize.Designer.cs deleted file mode 100644 index 7e1b7e7..0000000 --- a/Infrastructure/Migrations/20250109081041_Initialize.Designer.cs +++ /dev/null @@ -1,111 +0,0 @@ -// -using Infrastructure; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Infrastructure.Migrations -{ - [DbContext(typeof(OptifitDbContext))] - [Migration("20250109081041_Initialize")] - partial class Initialize - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.1"); - - modelBuilder.Entity("Infrastructure.Entities.Exercice", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("Description") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Duration") - .HasColumnType("REAL"); - - b.Property("Image") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("NbRepetitions") - .HasColumnType("INTEGER"); - - b.Property("NbSeries") - .HasColumnType("INTEGER"); - - b.Property("Video") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Exercices"); - }); - - modelBuilder.Entity("Infrastructure.Entities.User", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("Age") - .HasColumnType("INTEGER"); - - b.Property("EGoal") - .HasColumnType("TEXT"); - - b.Property("ESleepLevel") - .HasColumnType("TEXT"); - - b.Property("ESportLevel") - .HasColumnType("TEXT"); - - b.Property("HashPassword") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Height") - .HasColumnType("REAL"); - - b.Property("Logo") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("NbSessionPerWeek") - .HasColumnType("INTEGER"); - - b.Property("OAuthId") - .HasColumnType("TEXT"); - - b.Property("OAuthProvider") - .HasColumnType("TEXT"); - - b.Property("Sexe") - .HasColumnType("INTEGER"); - - b.Property("Weight") - .HasColumnType("REAL"); - - b.HasKey("Id"); - - b.ToTable("Users"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Infrastructure/Migrations/20250109081041_Initialize.cs b/Infrastructure/Migrations/20250109081041_Initialize.cs deleted file mode 100644 index 71d0170..0000000 --- a/Infrastructure/Migrations/20250109081041_Initialize.cs +++ /dev/null @@ -1,66 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Infrastructure.Migrations -{ - /// - public partial class Initialize : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Exercices", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - Name = table.Column(type: "TEXT", nullable: false), - Description = table.Column(type: "TEXT", nullable: false), - Duration = table.Column(type: "REAL", nullable: false), - Image = table.Column(type: "TEXT", nullable: false), - Video = table.Column(type: "TEXT", nullable: false), - NbSeries = table.Column(type: "INTEGER", nullable: false), - NbRepetitions = table.Column(type: "INTEGER", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Exercices", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Users", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - Name = table.Column(type: "TEXT", nullable: false), - Age = table.Column(type: "INTEGER", nullable: false), - Height = table.Column(type: "REAL", nullable: false), - Weight = table.Column(type: "REAL", nullable: false), - Sexe = table.Column(type: "INTEGER", nullable: false), - Logo = table.Column(type: "TEXT", nullable: false), - NbSessionPerWeek = table.Column(type: "INTEGER", nullable: false), - EGoal = table.Column(type: "TEXT", nullable: true), - ESleepLevel = table.Column(type: "TEXT", nullable: true), - ESportLevel = table.Column(type: "TEXT", nullable: true), - HashPassword = table.Column(type: "TEXT", nullable: false), - OAuthProvider = table.Column(type: "TEXT", nullable: true), - OAuthId = table.Column(type: "TEXT", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Users", x => x.Id); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Exercices"); - - migrationBuilder.DropTable( - name: "Users"); - } - } -} diff --git a/Infrastructure/Migrations/20250109094119_TrainingProgram.Designer.cs b/Infrastructure/Migrations/20250109094119_TrainingProgram.Designer.cs deleted file mode 100644 index 6e63217..0000000 --- a/Infrastructure/Migrations/20250109094119_TrainingProgram.Designer.cs +++ /dev/null @@ -1,191 +0,0 @@ -// -using Infrastructure; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Infrastructure.Migrations -{ - [DbContext(typeof(OptifitDbContext))] - [Migration("20250109094119_TrainingProgram")] - partial class TrainingProgram - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.1"); - - modelBuilder.Entity("Infrastructure.Entities.Exercice", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("Description") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Duration") - .HasColumnType("REAL"); - - b.Property("Image") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("NbRepetitions") - .HasColumnType("INTEGER"); - - b.Property("NbSeries") - .HasColumnType("INTEGER"); - - b.Property("SessionId") - .HasColumnType("TEXT"); - - b.Property("Video") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("SessionId"); - - b.ToTable("Exercices"); - }); - - modelBuilder.Entity("Infrastructure.Entities.Program", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("Description") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Difficulty") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WeekDuration") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("Programs"); - }); - - modelBuilder.Entity("Infrastructure.Entities.Session", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("Description") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Duration") - .HasColumnType("REAL"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ProgramId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("ProgramId"); - - b.ToTable("Sessions"); - }); - - modelBuilder.Entity("Infrastructure.Entities.User", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("Age") - .HasColumnType("INTEGER"); - - b.Property("EGoal") - .HasColumnType("TEXT"); - - b.Property("ESleepLevel") - .HasColumnType("TEXT"); - - b.Property("ESportLevel") - .HasColumnType("TEXT"); - - b.Property("HashPassword") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Height") - .HasColumnType("REAL"); - - b.Property("Logo") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("NbSessionPerWeek") - .HasColumnType("INTEGER"); - - b.Property("OAuthId") - .HasColumnType("TEXT"); - - b.Property("OAuthProvider") - .HasColumnType("TEXT"); - - b.Property("Sexe") - .HasColumnType("INTEGER"); - - b.Property("Weight") - .HasColumnType("REAL"); - - b.HasKey("Id"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Infrastructure.Entities.Exercice", b => - { - b.HasOne("Infrastructure.Entities.Session", null) - .WithMany("Exercices") - .HasForeignKey("SessionId"); - }); - - modelBuilder.Entity("Infrastructure.Entities.Session", b => - { - b.HasOne("Infrastructure.Entities.Program", null) - .WithMany("Sessions") - .HasForeignKey("ProgramId"); - }); - - modelBuilder.Entity("Infrastructure.Entities.Program", b => - { - b.Navigation("Sessions"); - }); - - modelBuilder.Entity("Infrastructure.Entities.Session", b => - { - b.Navigation("Exercices"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Infrastructure/Migrations/20250109094119_TrainingProgram.cs b/Infrastructure/Migrations/20250109094119_TrainingProgram.cs deleted file mode 100644 index 3237c77..0000000 --- a/Infrastructure/Migrations/20250109094119_TrainingProgram.cs +++ /dev/null @@ -1,94 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Infrastructure.Migrations -{ - /// - public partial class TrainingProgram : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "SessionId", - table: "Exercices", - type: "TEXT", - nullable: true); - - migrationBuilder.CreateTable( - name: "Programs", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - Name = table.Column(type: "TEXT", nullable: false), - WeekDuration = table.Column(type: "INTEGER", nullable: false), - Description = table.Column(type: "TEXT", nullable: false), - Difficulty = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Programs", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Sessions", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - Name = table.Column(type: "TEXT", nullable: false), - Description = table.Column(type: "TEXT", nullable: false), - Duration = table.Column(type: "REAL", nullable: false), - ProgramId = table.Column(type: "TEXT", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Sessions", x => x.Id); - table.ForeignKey( - name: "FK_Sessions_Programs_ProgramId", - column: x => x.ProgramId, - principalTable: "Programs", - principalColumn: "Id"); - }); - - migrationBuilder.CreateIndex( - name: "IX_Exercices_SessionId", - table: "Exercices", - column: "SessionId"); - - migrationBuilder.CreateIndex( - name: "IX_Sessions_ProgramId", - table: "Sessions", - column: "ProgramId"); - - migrationBuilder.AddForeignKey( - name: "FK_Exercices_Sessions_SessionId", - table: "Exercices", - column: "SessionId", - principalTable: "Sessions", - principalColumn: "Id"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Exercices_Sessions_SessionId", - table: "Exercices"); - - migrationBuilder.DropTable( - name: "Sessions"); - - migrationBuilder.DropTable( - name: "Programs"); - - migrationBuilder.DropIndex( - name: "IX_Exercices_SessionId", - table: "Exercices"); - - migrationBuilder.DropColumn( - name: "SessionId", - table: "Exercices"); - } - } -} diff --git a/Infrastructure/Migrations/20250109094527_Second.Designer.cs b/Infrastructure/Migrations/20250109094527_Second.Designer.cs deleted file mode 100644 index 5ec8b39..0000000 --- a/Infrastructure/Migrations/20250109094527_Second.Designer.cs +++ /dev/null @@ -1,117 +0,0 @@ -// -using Infrastructure; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Infrastructure.Migrations -{ - [DbContext(typeof(OptifitDbContext))] - [Migration("20250109094527_Second")] - partial class Second - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.1"); - - modelBuilder.Entity("Infrastructure.Entities.Exercice", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("Description") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Duration") - .HasColumnType("REAL"); - - b.Property("Image") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("NbRepetitions") - .HasColumnType("INTEGER"); - - b.Property("NbSeries") - .HasColumnType("INTEGER"); - - b.Property("Video") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Exercices"); - }); - - modelBuilder.Entity("Infrastructure.Entities.User", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("Age") - .HasColumnType("INTEGER"); - - b.Property("EGoal") - .HasColumnType("TEXT"); - - b.Property("EHealthProblem") - .HasColumnType("INTEGER"); - - b.Property("ESleepLevel") - .HasColumnType("INTEGER"); - - b.Property("ESport") - .HasColumnType("INTEGER"); - - b.Property("ESportLevel") - .HasColumnType("INTEGER"); - - b.Property("HashPassword") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Height") - .HasColumnType("REAL"); - - b.Property("Logo") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("NbSessionPerWeek") - .HasColumnType("INTEGER"); - - b.Property("OAuthId") - .HasColumnType("TEXT"); - - b.Property("OAuthProvider") - .HasColumnType("TEXT"); - - b.Property("Sexe") - .HasColumnType("INTEGER"); - - b.Property("Weight") - .HasColumnType("REAL"); - - b.HasKey("Id"); - - b.ToTable("Users"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Infrastructure/Migrations/20250109094527_Second.cs b/Infrastructure/Migrations/20250109094527_Second.cs deleted file mode 100644 index a09eabd..0000000 --- a/Infrastructure/Migrations/20250109094527_Second.cs +++ /dev/null @@ -1,75 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Infrastructure.Migrations -{ - /// - public partial class Second : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "ESportLevel", - table: "Users", - type: "INTEGER", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "ESleepLevel", - table: "Users", - type: "INTEGER", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AddColumn( - name: "EHealthProblem", - table: "Users", - type: "INTEGER", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "ESport", - table: "Users", - type: "INTEGER", - nullable: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "EHealthProblem", - table: "Users"); - - migrationBuilder.DropColumn( - name: "ESport", - table: "Users"); - - migrationBuilder.AlterColumn( - name: "ESportLevel", - table: "Users", - type: "TEXT", - nullable: true, - oldClrType: typeof(int), - oldType: "INTEGER", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "ESleepLevel", - table: "Users", - type: "TEXT", - nullable: true, - oldClrType: typeof(int), - oldType: "INTEGER", - oldNullable: true); - } - } -} diff --git a/Infrastructure/Migrations/OptifitDbContextModelSnapshot.cs b/Infrastructure/Migrations/OptifitDbContextModelSnapshot.cs deleted file mode 100644 index c8283ee..0000000 --- a/Infrastructure/Migrations/OptifitDbContextModelSnapshot.cs +++ /dev/null @@ -1,194 +0,0 @@ -// -using Infrastructure; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Infrastructure.Migrations -{ - [DbContext(typeof(OptifitDbContext))] - partial class OptifitDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.1"); - - modelBuilder.Entity("Infrastructure.Entities.Exercice", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("Description") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Duration") - .HasColumnType("REAL"); - - b.Property("Image") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("NbRepetitions") - .HasColumnType("INTEGER"); - - b.Property("NbSeries") - .HasColumnType("INTEGER"); - - b.Property("SessionId") - .HasColumnType("TEXT"); - - b.Property("Video") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("SessionId"); - - b.ToTable("Exercices"); - }); - - modelBuilder.Entity("Infrastructure.Entities.Program", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("Description") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Difficulty") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WeekDuration") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("Programs"); - }); - - modelBuilder.Entity("Infrastructure.Entities.Session", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("Description") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Duration") - .HasColumnType("REAL"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ProgramId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("ProgramId"); - - b.ToTable("Sessions"); - }); - - modelBuilder.Entity("Infrastructure.Entities.User", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("Age") - .HasColumnType("INTEGER"); - - b.Property("EGoal") - .HasColumnType("TEXT"); - - b.Property("EHealthProblem") - .HasColumnType("INTEGER"); - - b.Property("ESleepLevel") - .HasColumnType("INTEGER"); - - b.Property("ESport") - .HasColumnType("INTEGER"); - - b.Property("ESportLevel") - .HasColumnType("INTEGER"); - - b.Property("HashPassword") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Height") - .HasColumnType("REAL"); - - b.Property("Logo") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("NbSessionPerWeek") - .HasColumnType("INTEGER"); - - b.Property("OAuthId") - .HasColumnType("TEXT"); - - b.Property("OAuthProvider") - .HasColumnType("TEXT"); - - b.Property("Sexe") - .HasColumnType("INTEGER"); - - b.Property("Weight") - .HasColumnType("REAL"); - - b.HasKey("Id"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Infrastructure.Entities.Exercice", b => - { - b.HasOne("Infrastructure.Entities.Session", null) - .WithMany("Exercices") - .HasForeignKey("SessionId"); - }); - - modelBuilder.Entity("Infrastructure.Entities.Session", b => - { - b.HasOne("Infrastructure.Entities.Program", null) - .WithMany("Sessions") - .HasForeignKey("ProgramId"); - }); - - modelBuilder.Entity("Infrastructure.Entities.Program", b => - { - b.Navigation("Sessions"); - }); - - modelBuilder.Entity("Infrastructure.Entities.Session", b => - { - b.Navigation("Exercices"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Server/FirstTest.db b/Server/FirstTest.db deleted file mode 100644 index 10fd111e0aa66bb53bddce16ce31b0fd37f0b019..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 61440 zcmeI*-*4N-0S9nW)DK&Z%cIt%E75TYyF;c$z5YWw)J*9ODU*?Yu4$4aDZE#Ce}(s%(J;%0Nhc>G7Yr5Y zM)a>z!I7@yd};Zw>K~TgExlRlFLxL2F8;poS zm1bDcb{qG0wbmBz_ck}Rn_I1&-S&F3wX0RO-|I{)vfXaJzux{xd#~})TPI83VuPUH zJsNgDRbkFs^Q8?xTiY)#s1OxScrsST15k?h7+yV1Pe5?tD9WxT$s z)^2Px+KtxD#*UUu=NVlUg;6b57yl-`v9~5m-NTSQ8vOFWSk9Ll*T&!ZF||XFhrM|I zxO_TBT2$&Ut`y47Rrzr#j?=uCWNXmb?)Ucl^kFkha$FkKkY?*v;~uXM)8baNt=8$B zrpZ*QhiakhU6UXGC|OsUjbyFOFrAb=x3+ZFIQGfv(iuW#LhtkK#X|Y&Rr!mPeIVJ6 zWLP|1qTTuRO56^mMU{>u<@`OhJKtM5T+kxTZWSsoY;0N=w^_xv z(!J|cdsKZwbA@ubEdS?Q z^G*DR7tGsXk7g&j+1sDq2FKcQ+r7>DA2Rmw%zQO&_vk^=j;A|RrLn`0oJX7N6E=0` zQLjIoG4l=`JlLj#!LNG#vxm*mp<`?Pc=&+tV4v_qNdNq*`^W~qFXYG7( zQFV-XP+0z*bY1LrUwnLKx67CE@wv_8VIgiCpS&GMNcQw(xNy4GB$MZ_IO8Q=rtXMB zx|N;?%&0^!Za}+H)D4aghMy*`qcfIbb#39I_AAMB$4JH&)&EFu3os-5vWM2(<2{)l zTOIlHW=!1aG&bJv@+JSv_pp1oKe~S6-q3Ft*Jb6MaXi=1Eu+&s zn)1b00x~~V z-dRkeoV^Gje*fpy=aTwg_225Z>No1w{0lk=KmY;|fB*y_009U<00Izz00b_ZKvt3D zya;k4$cjJ_K}J!eMe+NeKlCrDminc-q&`)jsrN721|q)@fB*y_009U<00Izz00bZa zftL_iRrX{Wcr-9wmjpH4BbMRT33Y8oBEz&SJu-tZa`GagK`q<2eV=%C;1bLCd_rr! zNoWw7j?QE9_&E_Vigep`9GfR*hQ#9Igi_xkb!OJgn&m}2#jJ?vhknEi(|xdD$DI>e8BN<25Dkyi_ynjK_*qUIzpx;!(7>aC>AEDS=^n8Rw@#>QGZGo5W$BR_gwd2Y(x1GYej_(d$Do$&+rCdc zJ8=1%?LD8+nr{*sgr=kOgm`k3@3fyB-^h;Bi6Y&09mnQbF+*bUaYCtYkvcPLX3g@V zi}It4)A2(;VutAwYCC+p%(_QB%caE7b!xhLSTl@ZG7ppE8<}xBPMt-%=ZD1fT>i#> zGjxa_`ILBWNF%QnIyHNCI`TN3(DQY}VII-zVMHwIivIziGvey56&TF6Y(t;S!{oTQ z|DRWvB-K*CRF~AJ>NEBJ3yK)CApijgKmY;|fB*y_009U<00Ng;U{%?Z=ecB&7ZK;V fCXo{n=eg*R6%psTs-TF7^ISH_i1+``b6wznFnfZ0 diff --git a/Server/Mappers/TrainingProgramProfile.cs b/Server/Mappers/TrainingProgramProfile.cs index 3eb1a08..2932038 100644 --- a/Server/Mappers/TrainingProgramProfile.cs +++ b/Server/Mappers/TrainingProgramProfile.cs @@ -3,17 +3,23 @@ using Infrastructure.Entities; using Server.Dto.Request; using Server.Dto.Response; -namespace Server.Mappers +namespace Server.Mappers; + +public class TrainingProgramProfile : Profile { - public class TrainingProgramProfile : Profile + public TrainingProgramProfile() { - public TrainingProgramProfile() - { - CreateMap() - .ForMember(dest => dest.Sessions, opt => opt.MapFrom(src => src.Sessions)); + CreateMap() + .ForMember(dest => dest.Id, opt => opt.MapFrom(src => src.Id)) + .ForMember(dest => dest.Name, opt => opt.MapFrom(src => src.Name)) + .ForMember(dest => dest.Description, opt => opt.MapFrom(src => src.Description)) + .ForMember(dest => dest.WeekDuration, opt => opt.MapFrom(src => src.WeekDuration)) + .ForMember(dest => dest.Sessions, opt => opt.MapFrom(src => src.Sessions)); - CreateMap() - .ForMember(dest => dest, opt => opt.Ignore()); - } + CreateMap() + .ForMember(dest => dest.Name, opt => opt.MapFrom(src => src.Name)) + .ForMember(dest => dest.Description, opt => opt.MapFrom(src => src.Description)) + .ForMember(dest => dest.WeekDuration, opt => opt.MapFrom(src => src.WeekDuration)) + .ForMember(dest => dest.Sessions, opt => opt.MapFrom(src => src.Sessions)); } } \ No newline at end of file