From f23f225098d6d29446fa3eda167bbd4959ff8cb3 Mon Sep 17 00:00:00 2001 From: Andre Beging Date: Sat, 21 May 2022 13:56:21 +0200 Subject: [PATCH] Entities vereinfacht (kein Entity Developer mehr) --- .../Entity/Interaction.Generated.cs | 57 ------ .../Entity/Interaction.cs | 66 ++++++- .../Entity/InteractionDate.cs | 15 -- .../Entity/InteractionProcess.cs | 15 -- .../Entity/InteractionType.cs | 42 ++-- .../Entity/Prospect.Generated.cs | 48 ----- .../Entity/Prospect.cs | 49 ++++- .../Entity/User.Generated.cs | 56 ------ FoodsharingSiegen.Contracts/Entity/User.cs | 53 ++++- .../Entity/UserGroup.cs | 17 +- .../Entity/UserType.cs | 15 +- .../Data/FsContext.Generated.cs | 170 ---------------- FoodsharingSiegen.Server/Data/FsContext.cs | 100 +++++++++- .../Data/Service/ProspectService.cs | 4 +- .../Dialogs/AddInteractionModal.razor.cs | 4 +- .../20220401142848_Init.Designer.cs | 144 -------------- .../Migrations/20220401164353_asd.cs | 37 ---- .../20220401171855_asdk.Designer.cs | 157 --------------- .../Migrations/20220401171855_asdk.cs | 26 --- .../20220402121638_memonull.Designer.cs | 156 --------------- .../Migrations/20220402121638_memonull.cs | 33 ---- .../20220402141453_userpw.Designer.cs | 161 ---------------- .../Migrations/20220402141453_userpw.cs | 26 --- .../20220404113700_notneeded.Designer.cs | 165 ---------------- .../Migrations/20220404113700_notneeded.cs | 26 --- .../20220404113848_intercreated.Designer.cs | 169 ---------------- .../Migrations/20220404113848_intercreated.cs | 27 --- .../20220404143914_interalert.Designer.cs | 173 ----------------- .../Migrations/20220404143914_interalert.cs | 26 --- .../20220405143853_usergroups.Designer.cs | 178 ----------------- .../Migrations/20220405143853_usergroups.cs | 26 --- .../20220411114633_forcelogout.Designer.cs | 182 ------------------ .../Migrations/20220411114633_forcelogout.cs | 26 --- ...ner.cs => 20220521114808_init.Designer.cs} | 97 +++++----- ...1142848_Init.cs => 20220521114808_init.cs} | 34 ++-- .../Migrations/FsContextModelSnapshot.cs | 91 +++------ 36 files changed, 416 insertions(+), 2255 deletions(-) delete mode 100644 FoodsharingSiegen.Contracts/Entity/Interaction.Generated.cs delete mode 100644 FoodsharingSiegen.Contracts/Entity/InteractionDate.cs delete mode 100644 FoodsharingSiegen.Contracts/Entity/InteractionProcess.cs delete mode 100644 FoodsharingSiegen.Contracts/Entity/Prospect.Generated.cs delete mode 100644 FoodsharingSiegen.Contracts/Entity/User.Generated.cs delete mode 100644 FoodsharingSiegen.Server/Data/FsContext.Generated.cs delete mode 100644 FoodsharingSiegen.Server/Migrations/20220401142848_Init.Designer.cs delete mode 100644 FoodsharingSiegen.Server/Migrations/20220401164353_asd.cs delete mode 100644 FoodsharingSiegen.Server/Migrations/20220401171855_asdk.Designer.cs delete mode 100644 FoodsharingSiegen.Server/Migrations/20220401171855_asdk.cs delete mode 100644 FoodsharingSiegen.Server/Migrations/20220402121638_memonull.Designer.cs delete mode 100644 FoodsharingSiegen.Server/Migrations/20220402121638_memonull.cs delete mode 100644 FoodsharingSiegen.Server/Migrations/20220402141453_userpw.Designer.cs delete mode 100644 FoodsharingSiegen.Server/Migrations/20220402141453_userpw.cs delete mode 100644 FoodsharingSiegen.Server/Migrations/20220404113700_notneeded.Designer.cs delete mode 100644 FoodsharingSiegen.Server/Migrations/20220404113700_notneeded.cs delete mode 100644 FoodsharingSiegen.Server/Migrations/20220404113848_intercreated.Designer.cs delete mode 100644 FoodsharingSiegen.Server/Migrations/20220404113848_intercreated.cs delete mode 100644 FoodsharingSiegen.Server/Migrations/20220404143914_interalert.Designer.cs delete mode 100644 FoodsharingSiegen.Server/Migrations/20220404143914_interalert.cs delete mode 100644 FoodsharingSiegen.Server/Migrations/20220405143853_usergroups.Designer.cs delete mode 100644 FoodsharingSiegen.Server/Migrations/20220405143853_usergroups.cs delete mode 100644 FoodsharingSiegen.Server/Migrations/20220411114633_forcelogout.Designer.cs delete mode 100644 FoodsharingSiegen.Server/Migrations/20220411114633_forcelogout.cs rename FoodsharingSiegen.Server/Migrations/{20220401164353_asd.Designer.cs => 20220521114808_init.Designer.cs} (57%) rename FoodsharingSiegen.Server/Migrations/{20220401142848_Init.cs => 20220521114808_init.cs} (70%) diff --git a/FoodsharingSiegen.Contracts/Entity/Interaction.Generated.cs b/FoodsharingSiegen.Contracts/Entity/Interaction.Generated.cs deleted file mode 100644 index a8bcac6..0000000 --- a/FoodsharingSiegen.Contracts/Entity/Interaction.Generated.cs +++ /dev/null @@ -1,57 +0,0 @@ -//------------------------------------------------------------------------------ -// This is auto-generated code. -//------------------------------------------------------------------------------ -// This code was generated by Entity Developer tool using EF Core template. -// Code is generated on: 11.04.2022 17:16:51 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Data.Common; -using System.Linq; -using System.Linq.Expressions; - -namespace FoodsharingSiegen.Contracts.Entity -{ - public partial class Interaction { - - public Interaction() - { - OnCreated(); - } - - public virtual Guid Id { get; set; } - - public virtual Guid UserId { get; set; } - - public virtual DateTime Date { get; set; } - - public virtual string Info { get; set; } - - public virtual InteractionType Type { get; set; } - - public virtual Guid ProspectId { get; set; } - - public virtual bool Alert { get; set; } - - public virtual bool NotNeeded { get; set; } - - public virtual DateTime Created { get; set; } - - public virtual User User { get; set; } - - public virtual Prospect Prospect { get; set; } - - #region Extensibility Method Definitions - - partial void OnCreated(); - - #endregion - } - -} diff --git a/FoodsharingSiegen.Contracts/Entity/Interaction.cs b/FoodsharingSiegen.Contracts/Entity/Interaction.cs index 7c21a2e..2608f7d 100644 --- a/FoodsharingSiegen.Contracts/Entity/Interaction.cs +++ b/FoodsharingSiegen.Contracts/Entity/Interaction.cs @@ -1,6 +1,7 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel; +using System.ComponentModel.DataAnnotations; using System.Data; using System.Data.Common; using System.Linq; @@ -9,7 +10,68 @@ using System.Linq.Expressions; namespace FoodsharingSiegen.Contracts.Entity { - public partial class Interaction + /// + /// The interaction class (a. beging, 21.05.2022) + /// + public class Interaction { + #region Public Properties + + /// + /// Gets or sets the value of the alert (ab) + /// + public bool Alert { get; set; } + + /// + /// Gets or sets the value of the created (ab) + /// + public DateTime Created { get; set; } + + /// + /// Gets or sets the value of the date (ab) + /// + public DateTime Date { get; set; } + + /// + /// Gets or sets the value of the id (ab) + /// + [Key] public Guid Id { get; set; } + + /// + /// Gets or sets the value of the info (ab) + /// + public string? Info { get; set; } + + /// + /// Gets or sets the value of the not needed (ab) + /// + public bool NotNeeded { get; set; } + + /// + /// Gets or sets the value of the prospect (ab) + /// + public Prospect Prospect { get; set; } + + /// + /// Gets or sets the value of the prospect id (ab) + /// + public Guid ProspectID { get; set; } + + /// + /// Gets or sets the value of the type (ab) + /// + public InteractionType Type { get; set; } + + /// + /// Gets or sets the value of the user (ab) + /// + public User User { get; set; } + + /// + /// Gets or sets the value of the user id (ab) + /// + public Guid UserID { get; set; } + + #endregion } } diff --git a/FoodsharingSiegen.Contracts/Entity/InteractionDate.cs b/FoodsharingSiegen.Contracts/Entity/InteractionDate.cs deleted file mode 100644 index 9033328..0000000 --- a/FoodsharingSiegen.Contracts/Entity/InteractionDate.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Data.Common; -using System.Linq; -using System.Linq.Expressions; - -namespace FoodsharingSiegen.Contracts.Entity -{ - - public partial class InteractionDate - { - } -} diff --git a/FoodsharingSiegen.Contracts/Entity/InteractionProcess.cs b/FoodsharingSiegen.Contracts/Entity/InteractionProcess.cs deleted file mode 100644 index ad4e3d4..0000000 --- a/FoodsharingSiegen.Contracts/Entity/InteractionProcess.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Data.Common; -using System.Linq; -using System.Linq.Expressions; - -namespace FoodsharingSiegen.Contracts.Entity -{ - - public partial class InteractionProcess - { - } -} diff --git a/FoodsharingSiegen.Contracts/Entity/InteractionType.cs b/FoodsharingSiegen.Contracts/Entity/InteractionType.cs index 8da40ca..60bc430 100644 --- a/FoodsharingSiegen.Contracts/Entity/InteractionType.cs +++ b/FoodsharingSiegen.Contracts/Entity/InteractionType.cs @@ -1,31 +1,37 @@ -//------------------------------------------------------------------------------ -// This is auto-generated code. -//------------------------------------------------------------------------------ -// This code was generated by Entity Developer tool using EF Core template. -// Code is generated on: 11.04.2022 17:16:51 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Data.Common; -using System.Linq; -using System.Linq.Expressions; - namespace FoodsharingSiegen.Contracts.Entity { + /// + /// The interaction type enum + /// public enum InteractionType : int { + /// + /// The ein ab interaction type + /// EinAb = 10, + /// + /// The welcome interaction type + /// Welcome = 20, + /// + /// The id check interaction type + /// IdCheck = 30, + /// + /// The print pass interaction type + /// PrintPass = 40, + /// + /// The pdf pass interaction type + /// PdfPass = 50, + /// + /// The verify interaction type + /// Verify = 60, + /// + /// The complete interaction type + /// Complete = 70 } } diff --git a/FoodsharingSiegen.Contracts/Entity/Prospect.Generated.cs b/FoodsharingSiegen.Contracts/Entity/Prospect.Generated.cs deleted file mode 100644 index 03f3adc..0000000 --- a/FoodsharingSiegen.Contracts/Entity/Prospect.Generated.cs +++ /dev/null @@ -1,48 +0,0 @@ -//------------------------------------------------------------------------------ -// This is auto-generated code. -//------------------------------------------------------------------------------ -// This code was generated by Entity Developer tool using EF Core template. -// Code is generated on: 11.04.2022 17:16:51 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Data.Common; -using System.Linq; -using System.Linq.Expressions; - -namespace FoodsharingSiegen.Contracts.Entity -{ - public partial class Prospect { - - public Prospect() - { - this.Interactions = new List(); - OnCreated(); - } - - public virtual Guid Id { get; set; } - - public virtual int FsId { get; set; } - - public virtual string Name { get; set; } - - public virtual DateTime Created { get; set; } - - public virtual string Memo { get; set; } - - public virtual IList Interactions { get; set; } - - #region Extensibility Method Definitions - - partial void OnCreated(); - - #endregion - } - -} diff --git a/FoodsharingSiegen.Contracts/Entity/Prospect.cs b/FoodsharingSiegen.Contracts/Entity/Prospect.cs index b045bb9..2f700b1 100644 --- a/FoodsharingSiegen.Contracts/Entity/Prospect.cs +++ b/FoodsharingSiegen.Contracts/Entity/Prospect.cs @@ -1,8 +1,51 @@ -namespace FoodsharingSiegen.Contracts.Entity +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace FoodsharingSiegen.Contracts.Entity { - public partial class Prospect + /// + /// The prospect class (a. beging, 21.05.2022) + /// + public class Prospect { - public bool Complete => Interactions?.Any(x => x.Type == InteractionType.Complete) == true; + #region Public Properties + + /// + /// Gets the value of the complete (ab) + /// + [NotMapped] public bool Complete => Interactions?.Any(x => x.Type == InteractionType.Complete) == true; + + /// + /// Gets or sets the value of the created (ab) + /// + public DateTime Created { get; set; } + + /// + /// Gets or sets the value of the fs id (ab) + /// + public int FsId { get; set; } + + /// + /// Gets or sets the value of the id (ab) + /// + [Key] public Guid Id { get; set; } + + /// + /// Gets or sets the value of the interactions (ab) + /// + public IList Interactions { get; set; } + + /// + /// Gets or sets the value of the memo (ab) + /// + public string? Memo { get; set; } + + /// + /// Gets or sets the value of the name (ab) + /// + public string Name { get; set; } + + #endregion } } diff --git a/FoodsharingSiegen.Contracts/Entity/User.Generated.cs b/FoodsharingSiegen.Contracts/Entity/User.Generated.cs deleted file mode 100644 index f173947..0000000 --- a/FoodsharingSiegen.Contracts/Entity/User.Generated.cs +++ /dev/null @@ -1,56 +0,0 @@ -//------------------------------------------------------------------------------ -// This is auto-generated code. -//------------------------------------------------------------------------------ -// This code was generated by Entity Developer tool using EF Core template. -// Code is generated on: 11.04.2022 17:16:51 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Data.Common; -using System.Linq; -using System.Linq.Expressions; - -namespace FoodsharingSiegen.Contracts.Entity -{ - public partial class User { - - public User() - { - this.Interactions = new List(); - OnCreated(); - } - - public virtual Guid Id { get; set; } - - public virtual string Mail { get; set; } - - public virtual UserType Type { get; set; } - - public virtual bool Verified { get; set; } - - public virtual string Name { get; set; } - - public virtual DateTime Created { get; set; } - - public virtual string EncryptedPassword { get; set; } - - public virtual string Groups { get; set; } - - public virtual bool ForceLogout { get; set; } - - public virtual IList Interactions { get; set; } - - #region Extensibility Method Definitions - - partial void OnCreated(); - - #endregion - } - -} diff --git a/FoodsharingSiegen.Contracts/Entity/User.cs b/FoodsharingSiegen.Contracts/Entity/User.cs index 9a10e8a..5e2688f 100644 --- a/FoodsharingSiegen.Contracts/Entity/User.cs +++ b/FoodsharingSiegen.Contracts/Entity/User.cs @@ -1,3 +1,4 @@ +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using FoodsharingSiegen.Contracts.Helper; @@ -7,10 +8,30 @@ namespace FoodsharingSiegen.Contracts.Entity /// /// The user class (a. beging, 06.04.2022) /// - public partial class User + public class User { #region Public Properties + /// + /// Gets or sets the value of the created (ab) + /// + public DateTime Created { get; set; } + + /// + /// Gets or sets the value of the encrypted password (ab) + /// + public string EncryptedPassword { get; set; } + + /// + /// Gets or sets the value of the force logout (ab) + /// + public bool ForceLogout { get; set; } + + /// + /// Gets or sets the value of the groups (ab) + /// + public string Groups { get; set; } + /// /// Gets or sets the value of the groups list (ab) /// @@ -27,6 +48,26 @@ namespace FoodsharingSiegen.Contracts.Entity set => Groups = string.Join(",", value); } + /// + /// Gets or sets the value of the id (ab) + /// + [Key] public Guid Id { get; set; } + + /// + /// Gets or sets the value of the interactions (ab) + /// + public IList Interactions { get; set; } + + /// + /// Gets or sets the value of the mail (ab) + /// + public string Mail { get; set; } + + /// + /// Gets or sets the value of the name (ab) + /// + public string Name { get; set; } + /// /// Gets or sets the value of the password (ab) /// @@ -37,6 +78,16 @@ namespace FoodsharingSiegen.Contracts.Entity set => EncryptedPassword = Cryptor.Encrypt(value); } + /// + /// Gets or sets the value of the type (ab) + /// + public UserType Type { get; set; } + + /// + /// Gets or sets the value of the verified (ab) + /// + public bool Verified { get; set; } + #endregion #region Public Method Clone diff --git a/FoodsharingSiegen.Contracts/Entity/UserGroup.cs b/FoodsharingSiegen.Contracts/Entity/UserGroup.cs index 33f9279..6a1f87f 100644 --- a/FoodsharingSiegen.Contracts/Entity/UserGroup.cs +++ b/FoodsharingSiegen.Contracts/Entity/UserGroup.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // This is auto-generated code. //------------------------------------------------------------------------------ // This code was generated by Entity Developer tool using EF Core template. @@ -18,11 +18,26 @@ using System.Linq.Expressions; namespace FoodsharingSiegen.Contracts.Entity { + /// + /// The user group enum + /// public enum UserGroup : int { + /// + /// The read only user group + /// ReadOnly = 100, + /// + /// The welcome team user group + /// WelcomeTeam = 200, + /// + /// The store manager user group + /// StoreManager = 300, + /// + /// The ambassador user group + /// Ambassador = 400 } } diff --git a/FoodsharingSiegen.Contracts/Entity/UserType.cs b/FoodsharingSiegen.Contracts/Entity/UserType.cs index 59beabf..e223af3 100644 --- a/FoodsharingSiegen.Contracts/Entity/UserType.cs +++ b/FoodsharingSiegen.Contracts/Entity/UserType.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // This is auto-generated code. //------------------------------------------------------------------------------ // This code was generated by Entity Developer tool using EF Core template. @@ -18,11 +18,22 @@ using System.Linq.Expressions; namespace FoodsharingSiegen.Contracts.Entity { + /// + /// The user type enum + /// public enum UserType : int { + /// + /// The unverified user type + /// Unverified = 100, + /// + /// The user user type + /// User = 200, + /// + /// The admin user type + /// Admin = 300, - nix = 50 } } diff --git a/FoodsharingSiegen.Server/Data/FsContext.Generated.cs b/FoodsharingSiegen.Server/Data/FsContext.Generated.cs deleted file mode 100644 index 6744edb..0000000 --- a/FoodsharingSiegen.Server/Data/FsContext.Generated.cs +++ /dev/null @@ -1,170 +0,0 @@ -//------------------------------------------------------------------------------ -// This is auto-generated code. -//------------------------------------------------------------------------------ -// This code was generated by Entity Developer tool using EF Core template. -// Code is generated on: 11.04.2022 17:16:51 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Data.Common; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; -using System.Threading.Tasks; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Internal; -using Microsoft.EntityFrameworkCore.Metadata; -using FoodsharingSiegen.Contracts.Entity; - -namespace FoodsharingSiegen.Server.Data -{ - - public partial class FsContext : DbContext - { - - public FsContext() : - base() - { - OnCreated(); - } - - public FsContext(DbContextOptions options) : - base(options) - { - OnCreated(); - } - - protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) - { - if (!optionsBuilder.IsConfigured || - (!optionsBuilder.Options.Extensions.OfType().Any(ext => !string.IsNullOrEmpty(ext.ConnectionString) || ext.Connection != null) && - !optionsBuilder.Options.Extensions.Any(ext => !(ext is RelationalOptionsExtension) && !(ext is CoreOptionsExtension)))) - { - } - CustomizeConfiguration(ref optionsBuilder); - base.OnConfiguring(optionsBuilder); - } - - partial void CustomizeConfiguration(ref DbContextOptionsBuilder optionsBuilder); - - public virtual DbSet Users - { - get; - set; - } - - public virtual DbSet Prospects - { - get; - set; - } - - public virtual DbSet Interactions - { - get; - set; - } - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - base.OnModelCreating(modelBuilder); - - this.UserMapping(modelBuilder); - this.CustomizeUserMapping(modelBuilder); - - this.ProspectMapping(modelBuilder); - this.CustomizeProspectMapping(modelBuilder); - - this.InteractionMapping(modelBuilder); - this.CustomizeInteractionMapping(modelBuilder); - - RelationshipsMapping(modelBuilder); - CustomizeMapping(ref modelBuilder); - } - - #region User Mapping - - private void UserMapping(ModelBuilder modelBuilder) - { - modelBuilder.Entity().ToTable(@"Users"); - modelBuilder.Entity().Property(x => x.Id).HasColumnName(@"Id").IsRequired().ValueGeneratedOnAdd(); - modelBuilder.Entity().Property(x => x.Mail).HasColumnName(@"Mail").IsRequired().ValueGeneratedNever(); - modelBuilder.Entity().Property(x => x.Type).HasColumnName(@"Type").IsRequired().ValueGeneratedNever(); - modelBuilder.Entity().Property(x => x.Verified).HasColumnName(@"Verified").IsRequired().ValueGeneratedNever(); - modelBuilder.Entity().Property(x => x.Name).HasColumnName(@"Name").IsRequired().ValueGeneratedNever(); - modelBuilder.Entity().Property(x => x.Created).HasColumnName(@"Created").IsRequired().ValueGeneratedNever(); - modelBuilder.Entity().Property(x => x.EncryptedPassword).HasColumnName(@"EncryptedPassword").IsRequired().ValueGeneratedNever(); - modelBuilder.Entity().Property(x => x.Groups).HasColumnName(@"Groups").IsRequired().ValueGeneratedNever(); - modelBuilder.Entity().Property(x => x.ForceLogout).HasColumnName(@"ForceLogout").IsRequired().ValueGeneratedNever(); - modelBuilder.Entity().HasKey(@"Id"); - } - - partial void CustomizeUserMapping(ModelBuilder modelBuilder); - - #endregion - - #region Prospect Mapping - - private void ProspectMapping(ModelBuilder modelBuilder) - { - modelBuilder.Entity().ToTable(@"Prospects"); - modelBuilder.Entity().Property(x => x.Id).HasColumnName(@"Id").IsRequired().ValueGeneratedOnAdd(); - modelBuilder.Entity().Property(x => x.FsId).HasColumnName(@"FsId").IsRequired().ValueGeneratedNever(); - modelBuilder.Entity().Property(x => x.Name).HasColumnName(@"Name").IsRequired().ValueGeneratedNever(); - modelBuilder.Entity().Property(x => x.Created).HasColumnName(@"Created").IsRequired().ValueGeneratedNever(); - modelBuilder.Entity().Property(x => x.Memo).HasColumnName(@"Memo").ValueGeneratedNever(); - modelBuilder.Entity().HasKey(@"Id"); - } - - partial void CustomizeProspectMapping(ModelBuilder modelBuilder); - - #endregion - - #region Interaction Mapping - - private void InteractionMapping(ModelBuilder modelBuilder) - { - modelBuilder.Entity().ToTable(@"Interactions"); - modelBuilder.Entity().Property(x => x.Id).HasColumnName(@"Id").IsRequired().ValueGeneratedOnAdd(); - modelBuilder.Entity().Property(x => x.UserId).HasColumnName(@"UserId").ValueGeneratedNever(); - modelBuilder.Entity().Property(x => x.Date).HasColumnName(@"Date").IsRequired().ValueGeneratedNever(); - modelBuilder.Entity().Property(x => x.Info).HasColumnName(@"Info").ValueGeneratedNever(); - modelBuilder.Entity().Property(x => x.Type).HasColumnName(@"Type").IsRequired().ValueGeneratedNever(); - modelBuilder.Entity().Property(x => x.ProspectId).HasColumnName(@"ProspectId").ValueGeneratedNever(); - modelBuilder.Entity().Property(x => x.Alert).HasColumnName(@"Alert").IsRequired().ValueGeneratedNever(); - modelBuilder.Entity().Property(x => x.NotNeeded).HasColumnName(@"NotNeeded").IsRequired().ValueGeneratedNever(); - modelBuilder.Entity().Property(x => x.Created).HasColumnName(@"Created").IsRequired().ValueGeneratedNever(); - modelBuilder.Entity().HasKey(@"Id"); - } - - partial void CustomizeInteractionMapping(ModelBuilder modelBuilder); - - #endregion - - private void RelationshipsMapping(ModelBuilder modelBuilder) - { - modelBuilder.Entity().HasMany(x => x.Interactions).WithOne(op => op.User).HasForeignKey(@"UserId").IsRequired(true); - - modelBuilder.Entity().HasMany(x => x.Interactions).WithOne(op => op.Prospect).HasForeignKey(@"ProspectId").IsRequired(true); - - modelBuilder.Entity().HasOne(x => x.User).WithMany(op => op.Interactions).HasForeignKey(@"UserId").IsRequired(true); - modelBuilder.Entity().HasOne(x => x.Prospect).WithMany(op => op.Interactions).HasForeignKey(@"ProspectId").IsRequired(true); - } - - partial void CustomizeMapping(ref ModelBuilder modelBuilder); - - public bool HasChanges() - { - return ChangeTracker.Entries().Any(e => e.State == Microsoft.EntityFrameworkCore.EntityState.Added || e.State == Microsoft.EntityFrameworkCore.EntityState.Modified || e.State == Microsoft.EntityFrameworkCore.EntityState.Deleted); - } - - partial void OnCreated(); - } -} diff --git a/FoodsharingSiegen.Server/Data/FsContext.cs b/FoodsharingSiegen.Server/Data/FsContext.cs index 998fdc2..86ecba6 100644 --- a/FoodsharingSiegen.Server/Data/FsContext.cs +++ b/FoodsharingSiegen.Server/Data/FsContext.cs @@ -1,11 +1,99 @@ -namespace FoodsharingSiegen.Server.Data -{ +using FoodsharingSiegen.Contracts.Entity; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; - public partial class FsContext +namespace FoodsharingSiegen.Server.Data +{ + /// + /// The fs context class (a. beging, 21.05.2022) + /// + /// + public class FsContext : DbContext { - partial void OnCreated() + #region Public Properties + + /// + /// Gets or sets the value of the interactions (ab) + /// + public DbSet Interactions { get; set; } + + /// + /// Gets or sets the value of the prospects (ab) + /// + public DbSet Prospects { get; set; } + + /// + /// Gets or sets the value of the users (ab) + /// + public DbSet Users { get; set; } + + #endregion + + #region Setup/Teardown + + /// + /// Initializes a new instance of the class + /// + public FsContext() : + base() { - Database.EnsureCreated(); + OnCreated(); } + + /// + /// Initializes a new instance of the class + /// + /// The options (ab) + public FsContext(DbContextOptions options) : + base(options) + { + OnCreated(); + } + + #endregion + + #region Override OnConfiguring + + /// + /// Ons the configuring using the specified options builder (a. beging, 21.05.2022) + /// + /// The options builder + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + if (!optionsBuilder.IsConfigured || + (!optionsBuilder.Options.Extensions.OfType().Any(ext => !string.IsNullOrEmpty(ext.ConnectionString) || ext.Connection != null) && + !optionsBuilder.Options.Extensions.Any(ext => !(ext is RelationalOptionsExtension) && !(ext is CoreOptionsExtension)))) + { + } + + base.OnConfiguring(optionsBuilder); + } + + #endregion + + #region Public Method HasChanges + + /// + /// Describes whether this instance has changes + /// + /// The bool + public bool HasChanges() + { + return ChangeTracker.Entries().Any(e => e.State == Microsoft.EntityFrameworkCore.EntityState.Added || e.State == Microsoft.EntityFrameworkCore.EntityState.Modified || e.State == Microsoft.EntityFrameworkCore.EntityState.Deleted); + } + + #endregion + + #region Private Method OnCreated + + /// + /// Ons the created (a. beging, 21.05.2022) + /// + private void OnCreated() + { + // Database.EnsureCreated(); + } + + #endregion } -} +} \ No newline at end of file diff --git a/FoodsharingSiegen.Server/Data/Service/ProspectService.cs b/FoodsharingSiegen.Server/Data/Service/ProspectService.cs index 613ae85..e8a0fe8 100644 --- a/FoodsharingSiegen.Server/Data/Service/ProspectService.cs +++ b/FoodsharingSiegen.Server/Data/Service/ProspectService.cs @@ -31,10 +31,10 @@ namespace FoodsharingSiegen.Server.Data.Service { try { - var targetProspect = await Context.Prospects.Include(x => x.Interactions).FirstOrDefaultAsync(x => x.Id == interaction.ProspectId); + var targetProspect = await Context.Prospects.Include(x => x.Interactions).FirstOrDefaultAsync(x => x.Id == interaction.ProspectID); if (targetProspect == null) return new OperationResult(new Exception("Invalid prospect id")); - interaction.ProspectId = Guid.Empty; + interaction.ProspectID = Guid.Empty; interaction.Created = DateTime.UtcNow; targetProspect.Interactions.Add(interaction); diff --git a/FoodsharingSiegen.Server/Dialogs/AddInteractionModal.razor.cs b/FoodsharingSiegen.Server/Dialogs/AddInteractionModal.razor.cs index 463f222..f3003b6 100644 --- a/FoodsharingSiegen.Server/Dialogs/AddInteractionModal.razor.cs +++ b/FoodsharingSiegen.Server/Dialogs/AddInteractionModal.razor.cs @@ -78,14 +78,14 @@ namespace FoodsharingSiegen.Server.Dialogs { Type = type, Date = DateTime.UtcNow, - ProspectId = prospectId.Value + ProspectID = prospectId.Value }; await ModalReference.Show(); } private async Task AddInteraction() { - Interaction.UserId = SelectedUser; + Interaction.UserID = SelectedUser; await OnAdd.InvokeAsync(Interaction); await ModalReference.Hide(); diff --git a/FoodsharingSiegen.Server/Migrations/20220401142848_Init.Designer.cs b/FoodsharingSiegen.Server/Migrations/20220401142848_Init.Designer.cs deleted file mode 100644 index ff924f8..0000000 --- a/FoodsharingSiegen.Server/Migrations/20220401142848_Init.Designer.cs +++ /dev/null @@ -1,144 +0,0 @@ -// -using System; -using FoodsharingSiegen.Server.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace FoodsharingSiegen.Server.Migrations -{ - [DbContext(typeof(FsContext))] - [Migration("20220401142848_Init")] - partial class Init - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "6.0.1"); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("Date") - .HasColumnType("TEXT") - .HasColumnName("Date"); - - b.Property("ProspectId") - .HasColumnType("TEXT") - .HasColumnName("ProspectId"); - - b.Property("Type") - .HasColumnType("INTEGER") - .HasColumnName("Type"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("UserId"); - - b.HasKey("Id"); - - b.HasIndex("ProspectId"); - - b.HasIndex("UserId"); - - b.ToTable("Interactions", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("FsId") - .HasColumnType("INTEGER") - .HasColumnName("FsId"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Name"); - - b.Property("ProgressId") - .HasColumnType("TEXT") - .HasColumnName("ProgressId"); - - b.HasKey("Id"); - - b.ToTable("Prospects", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("Created") - .HasColumnType("TEXT") - .HasColumnName("Created"); - - b.Property("Mail") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Mail"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Name"); - - b.Property("Type") - .HasColumnType("INTEGER") - .HasColumnName("Type"); - - b.Property("Verified") - .HasColumnType("INTEGER") - .HasColumnName("Verified"); - - b.HasKey("Id"); - - b.ToTable("Users", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b => - { - b.HasOne("FoodsharingSiegen.Contracts.Entity.Prospect", "Prospect") - .WithMany("Interactions") - .HasForeignKey("ProspectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("FoodsharingSiegen.Contracts.Entity.User", "User") - .WithMany("Interactions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Prospect"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b => - { - b.Navigation("Interactions"); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b => - { - b.Navigation("Interactions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/FoodsharingSiegen.Server/Migrations/20220401164353_asd.cs b/FoodsharingSiegen.Server/Migrations/20220401164353_asd.cs deleted file mode 100644 index 2ee6fe8..0000000 --- a/FoodsharingSiegen.Server/Migrations/20220401164353_asd.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace FoodsharingSiegen.Server.Migrations -{ - public partial class asd : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "Created", - table: "Prospects", - type: "TEXT", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.AddColumn( - name: "Info", - table: "Interactions", - type: "TEXT", - nullable: true); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Created", - table: "Prospects"); - - migrationBuilder.DropColumn( - name: "Info", - table: "Interactions"); - } - } -} diff --git a/FoodsharingSiegen.Server/Migrations/20220401171855_asdk.Designer.cs b/FoodsharingSiegen.Server/Migrations/20220401171855_asdk.Designer.cs deleted file mode 100644 index 9c251ec..0000000 --- a/FoodsharingSiegen.Server/Migrations/20220401171855_asdk.Designer.cs +++ /dev/null @@ -1,157 +0,0 @@ -// -using System; -using FoodsharingSiegen.Server.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace FoodsharingSiegen.Server.Migrations -{ - [DbContext(typeof(FsContext))] - [Migration("20220401171855_asdk")] - partial class asdk - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "6.0.1"); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("Date") - .HasColumnType("TEXT") - .HasColumnName("Date"); - - b.Property("Info") - .HasColumnType("TEXT") - .HasColumnName("Info"); - - b.Property("ProspectId") - .HasColumnType("TEXT") - .HasColumnName("ProspectId"); - - b.Property("Type") - .HasColumnType("INTEGER") - .HasColumnName("Type"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("UserId"); - - b.HasKey("Id"); - - b.HasIndex("ProspectId"); - - b.HasIndex("UserId"); - - b.ToTable("Interactions", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("Created") - .HasColumnType("TEXT") - .HasColumnName("Created"); - - b.Property("FsId") - .HasColumnType("INTEGER") - .HasColumnName("FsId"); - - b.Property("Memo") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Memo"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Name"); - - b.Property("ProgressId") - .HasColumnType("TEXT") - .HasColumnName("ProgressId"); - - b.HasKey("Id"); - - b.ToTable("Prospects", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("Created") - .HasColumnType("TEXT") - .HasColumnName("Created"); - - b.Property("Mail") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Mail"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Name"); - - b.Property("Type") - .HasColumnType("INTEGER") - .HasColumnName("Type"); - - b.Property("Verified") - .HasColumnType("INTEGER") - .HasColumnName("Verified"); - - b.HasKey("Id"); - - b.ToTable("Users", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b => - { - b.HasOne("FoodsharingSiegen.Contracts.Entity.Prospect", "Prospect") - .WithMany("Interactions") - .HasForeignKey("ProspectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("FoodsharingSiegen.Contracts.Entity.User", "User") - .WithMany("Interactions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Prospect"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b => - { - b.Navigation("Interactions"); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b => - { - b.Navigation("Interactions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/FoodsharingSiegen.Server/Migrations/20220401171855_asdk.cs b/FoodsharingSiegen.Server/Migrations/20220401171855_asdk.cs deleted file mode 100644 index eecd016..0000000 --- a/FoodsharingSiegen.Server/Migrations/20220401171855_asdk.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace FoodsharingSiegen.Server.Migrations -{ - public partial class asdk : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "Memo", - table: "Prospects", - type: "TEXT", - nullable: false, - defaultValue: ""); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Memo", - table: "Prospects"); - } - } -} diff --git a/FoodsharingSiegen.Server/Migrations/20220402121638_memonull.Designer.cs b/FoodsharingSiegen.Server/Migrations/20220402121638_memonull.Designer.cs deleted file mode 100644 index 1123305..0000000 --- a/FoodsharingSiegen.Server/Migrations/20220402121638_memonull.Designer.cs +++ /dev/null @@ -1,156 +0,0 @@ -// -using System; -using FoodsharingSiegen.Server.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace FoodsharingSiegen.Server.Migrations -{ - [DbContext(typeof(FsContext))] - [Migration("20220402121638_memonull")] - partial class memonull - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "6.0.1"); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("Date") - .HasColumnType("TEXT") - .HasColumnName("Date"); - - b.Property("Info") - .HasColumnType("TEXT") - .HasColumnName("Info"); - - b.Property("ProspectId") - .HasColumnType("TEXT") - .HasColumnName("ProspectId"); - - b.Property("Type") - .HasColumnType("INTEGER") - .HasColumnName("Type"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("UserId"); - - b.HasKey("Id"); - - b.HasIndex("ProspectId"); - - b.HasIndex("UserId"); - - b.ToTable("Interactions", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("Created") - .HasColumnType("TEXT") - .HasColumnName("Created"); - - b.Property("FsId") - .HasColumnType("INTEGER") - .HasColumnName("FsId"); - - b.Property("Memo") - .HasColumnType("TEXT") - .HasColumnName("Memo"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Name"); - - b.Property("ProgressId") - .HasColumnType("TEXT") - .HasColumnName("ProgressId"); - - b.HasKey("Id"); - - b.ToTable("Prospects", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("Created") - .HasColumnType("TEXT") - .HasColumnName("Created"); - - b.Property("Mail") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Mail"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Name"); - - b.Property("Type") - .HasColumnType("INTEGER") - .HasColumnName("Type"); - - b.Property("Verified") - .HasColumnType("INTEGER") - .HasColumnName("Verified"); - - b.HasKey("Id"); - - b.ToTable("Users", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b => - { - b.HasOne("FoodsharingSiegen.Contracts.Entity.Prospect", "Prospect") - .WithMany("Interactions") - .HasForeignKey("ProspectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("FoodsharingSiegen.Contracts.Entity.User", "User") - .WithMany("Interactions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Prospect"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b => - { - b.Navigation("Interactions"); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b => - { - b.Navigation("Interactions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/FoodsharingSiegen.Server/Migrations/20220402121638_memonull.cs b/FoodsharingSiegen.Server/Migrations/20220402121638_memonull.cs deleted file mode 100644 index 8e9305e..0000000 --- a/FoodsharingSiegen.Server/Migrations/20220402121638_memonull.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace FoodsharingSiegen.Server.Migrations -{ - public partial class memonull : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "Memo", - table: "Prospects", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "Memo", - table: "Prospects", - type: "TEXT", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - } - } -} diff --git a/FoodsharingSiegen.Server/Migrations/20220402141453_userpw.Designer.cs b/FoodsharingSiegen.Server/Migrations/20220402141453_userpw.Designer.cs deleted file mode 100644 index ed00571..0000000 --- a/FoodsharingSiegen.Server/Migrations/20220402141453_userpw.Designer.cs +++ /dev/null @@ -1,161 +0,0 @@ -// -using System; -using FoodsharingSiegen.Server.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace FoodsharingSiegen.Server.Migrations -{ - [DbContext(typeof(FsContext))] - [Migration("20220402141453_userpw")] - partial class userpw - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "6.0.1"); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("Date") - .HasColumnType("TEXT") - .HasColumnName("Date"); - - b.Property("Info") - .HasColumnType("TEXT") - .HasColumnName("Info"); - - b.Property("ProspectId") - .HasColumnType("TEXT") - .HasColumnName("ProspectId"); - - b.Property("Type") - .HasColumnType("INTEGER") - .HasColumnName("Type"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("UserId"); - - b.HasKey("Id"); - - b.HasIndex("ProspectId"); - - b.HasIndex("UserId"); - - b.ToTable("Interactions", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("Created") - .HasColumnType("TEXT") - .HasColumnName("Created"); - - b.Property("FsId") - .HasColumnType("INTEGER") - .HasColumnName("FsId"); - - b.Property("Memo") - .HasColumnType("TEXT") - .HasColumnName("Memo"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Name"); - - b.Property("ProgressId") - .HasColumnType("TEXT") - .HasColumnName("ProgressId"); - - b.HasKey("Id"); - - b.ToTable("Prospects", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("Created") - .HasColumnType("TEXT") - .HasColumnName("Created"); - - b.Property("EncryptedPassword") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("EncryptedPassword"); - - b.Property("Mail") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Mail"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Name"); - - b.Property("Type") - .HasColumnType("INTEGER") - .HasColumnName("Type"); - - b.Property("Verified") - .HasColumnType("INTEGER") - .HasColumnName("Verified"); - - b.HasKey("Id"); - - b.ToTable("Users", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b => - { - b.HasOne("FoodsharingSiegen.Contracts.Entity.Prospect", "Prospect") - .WithMany("Interactions") - .HasForeignKey("ProspectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("FoodsharingSiegen.Contracts.Entity.User", "User") - .WithMany("Interactions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Prospect"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b => - { - b.Navigation("Interactions"); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b => - { - b.Navigation("Interactions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/FoodsharingSiegen.Server/Migrations/20220402141453_userpw.cs b/FoodsharingSiegen.Server/Migrations/20220402141453_userpw.cs deleted file mode 100644 index b787583..0000000 --- a/FoodsharingSiegen.Server/Migrations/20220402141453_userpw.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace FoodsharingSiegen.Server.Migrations -{ - public partial class userpw : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "EncryptedPassword", - table: "Users", - type: "TEXT", - nullable: false, - defaultValue: ""); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "EncryptedPassword", - table: "Users"); - } - } -} diff --git a/FoodsharingSiegen.Server/Migrations/20220404113700_notneeded.Designer.cs b/FoodsharingSiegen.Server/Migrations/20220404113700_notneeded.Designer.cs deleted file mode 100644 index 79a6bf2..0000000 --- a/FoodsharingSiegen.Server/Migrations/20220404113700_notneeded.Designer.cs +++ /dev/null @@ -1,165 +0,0 @@ -// -using System; -using FoodsharingSiegen.Server.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace FoodsharingSiegen.Server.Migrations -{ - [DbContext(typeof(FsContext))] - [Migration("20220404113700_notneeded")] - partial class notneeded - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "6.0.1"); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("Date") - .HasColumnType("TEXT") - .HasColumnName("Date"); - - b.Property("Info") - .HasColumnType("TEXT") - .HasColumnName("Info"); - - b.Property("NotNeeded") - .HasColumnType("INTEGER") - .HasColumnName("NotNeeded"); - - b.Property("ProspectId") - .HasColumnType("TEXT") - .HasColumnName("ProspectId"); - - b.Property("Type") - .HasColumnType("INTEGER") - .HasColumnName("Type"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("UserId"); - - b.HasKey("Id"); - - b.HasIndex("ProspectId"); - - b.HasIndex("UserId"); - - b.ToTable("Interactions", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("Created") - .HasColumnType("TEXT") - .HasColumnName("Created"); - - b.Property("FsId") - .HasColumnType("INTEGER") - .HasColumnName("FsId"); - - b.Property("Memo") - .HasColumnType("TEXT") - .HasColumnName("Memo"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Name"); - - b.Property("ProgressId") - .HasColumnType("TEXT") - .HasColumnName("ProgressId"); - - b.HasKey("Id"); - - b.ToTable("Prospects", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("Created") - .HasColumnType("TEXT") - .HasColumnName("Created"); - - b.Property("EncryptedPassword") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("EncryptedPassword"); - - b.Property("Mail") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Mail"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Name"); - - b.Property("Type") - .HasColumnType("INTEGER") - .HasColumnName("Type"); - - b.Property("Verified") - .HasColumnType("INTEGER") - .HasColumnName("Verified"); - - b.HasKey("Id"); - - b.ToTable("Users", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b => - { - b.HasOne("FoodsharingSiegen.Contracts.Entity.Prospect", "Prospect") - .WithMany("Interactions") - .HasForeignKey("ProspectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("FoodsharingSiegen.Contracts.Entity.User", "User") - .WithMany("Interactions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Prospect"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b => - { - b.Navigation("Interactions"); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b => - { - b.Navigation("Interactions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/FoodsharingSiegen.Server/Migrations/20220404113700_notneeded.cs b/FoodsharingSiegen.Server/Migrations/20220404113700_notneeded.cs deleted file mode 100644 index 78b9827..0000000 --- a/FoodsharingSiegen.Server/Migrations/20220404113700_notneeded.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace FoodsharingSiegen.Server.Migrations -{ - public partial class notneeded : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "NotNeeded", - table: "Interactions", - type: "INTEGER", - nullable: false, - defaultValue: false); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "NotNeeded", - table: "Interactions"); - } - } -} diff --git a/FoodsharingSiegen.Server/Migrations/20220404113848_intercreated.Designer.cs b/FoodsharingSiegen.Server/Migrations/20220404113848_intercreated.Designer.cs deleted file mode 100644 index b52cad2..0000000 --- a/FoodsharingSiegen.Server/Migrations/20220404113848_intercreated.Designer.cs +++ /dev/null @@ -1,169 +0,0 @@ -// -using System; -using FoodsharingSiegen.Server.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace FoodsharingSiegen.Server.Migrations -{ - [DbContext(typeof(FsContext))] - [Migration("20220404113848_intercreated")] - partial class intercreated - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "6.0.1"); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("Created") - .HasColumnType("TEXT") - .HasColumnName("Created"); - - b.Property("Date") - .HasColumnType("TEXT") - .HasColumnName("Date"); - - b.Property("Info") - .HasColumnType("TEXT") - .HasColumnName("Info"); - - b.Property("NotNeeded") - .HasColumnType("INTEGER") - .HasColumnName("NotNeeded"); - - b.Property("ProspectId") - .HasColumnType("TEXT") - .HasColumnName("ProspectId"); - - b.Property("Type") - .HasColumnType("INTEGER") - .HasColumnName("Type"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("UserId"); - - b.HasKey("Id"); - - b.HasIndex("ProspectId"); - - b.HasIndex("UserId"); - - b.ToTable("Interactions", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("Created") - .HasColumnType("TEXT") - .HasColumnName("Created"); - - b.Property("FsId") - .HasColumnType("INTEGER") - .HasColumnName("FsId"); - - b.Property("Memo") - .HasColumnType("TEXT") - .HasColumnName("Memo"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Name"); - - b.Property("ProgressId") - .HasColumnType("TEXT") - .HasColumnName("ProgressId"); - - b.HasKey("Id"); - - b.ToTable("Prospects", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("Created") - .HasColumnType("TEXT") - .HasColumnName("Created"); - - b.Property("EncryptedPassword") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("EncryptedPassword"); - - b.Property("Mail") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Mail"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Name"); - - b.Property("Type") - .HasColumnType("INTEGER") - .HasColumnName("Type"); - - b.Property("Verified") - .HasColumnType("INTEGER") - .HasColumnName("Verified"); - - b.HasKey("Id"); - - b.ToTable("Users", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b => - { - b.HasOne("FoodsharingSiegen.Contracts.Entity.Prospect", "Prospect") - .WithMany("Interactions") - .HasForeignKey("ProspectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("FoodsharingSiegen.Contracts.Entity.User", "User") - .WithMany("Interactions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Prospect"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b => - { - b.Navigation("Interactions"); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b => - { - b.Navigation("Interactions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/FoodsharingSiegen.Server/Migrations/20220404113848_intercreated.cs b/FoodsharingSiegen.Server/Migrations/20220404113848_intercreated.cs deleted file mode 100644 index 37f935a..0000000 --- a/FoodsharingSiegen.Server/Migrations/20220404113848_intercreated.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace FoodsharingSiegen.Server.Migrations -{ - public partial class intercreated : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "Created", - table: "Interactions", - type: "TEXT", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Created", - table: "Interactions"); - } - } -} diff --git a/FoodsharingSiegen.Server/Migrations/20220404143914_interalert.Designer.cs b/FoodsharingSiegen.Server/Migrations/20220404143914_interalert.Designer.cs deleted file mode 100644 index 348d405..0000000 --- a/FoodsharingSiegen.Server/Migrations/20220404143914_interalert.Designer.cs +++ /dev/null @@ -1,173 +0,0 @@ -// -using System; -using FoodsharingSiegen.Server.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace FoodsharingSiegen.Server.Migrations -{ - [DbContext(typeof(FsContext))] - [Migration("20220404143914_interalert")] - partial class interalert - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "6.0.1"); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("Alert") - .HasColumnType("INTEGER") - .HasColumnName("Alert"); - - b.Property("Created") - .HasColumnType("TEXT") - .HasColumnName("Created"); - - b.Property("Date") - .HasColumnType("TEXT") - .HasColumnName("Date"); - - b.Property("Info") - .HasColumnType("TEXT") - .HasColumnName("Info"); - - b.Property("NotNeeded") - .HasColumnType("INTEGER") - .HasColumnName("NotNeeded"); - - b.Property("ProspectId") - .HasColumnType("TEXT") - .HasColumnName("ProspectId"); - - b.Property("Type") - .HasColumnType("INTEGER") - .HasColumnName("Type"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("UserId"); - - b.HasKey("Id"); - - b.HasIndex("ProspectId"); - - b.HasIndex("UserId"); - - b.ToTable("Interactions", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("Created") - .HasColumnType("TEXT") - .HasColumnName("Created"); - - b.Property("FsId") - .HasColumnType("INTEGER") - .HasColumnName("FsId"); - - b.Property("Memo") - .HasColumnType("TEXT") - .HasColumnName("Memo"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Name"); - - b.Property("ProgressId") - .HasColumnType("TEXT") - .HasColumnName("ProgressId"); - - b.HasKey("Id"); - - b.ToTable("Prospects", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("Created") - .HasColumnType("TEXT") - .HasColumnName("Created"); - - b.Property("EncryptedPassword") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("EncryptedPassword"); - - b.Property("Mail") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Mail"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Name"); - - b.Property("Type") - .HasColumnType("INTEGER") - .HasColumnName("Type"); - - b.Property("Verified") - .HasColumnType("INTEGER") - .HasColumnName("Verified"); - - b.HasKey("Id"); - - b.ToTable("Users", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b => - { - b.HasOne("FoodsharingSiegen.Contracts.Entity.Prospect", "Prospect") - .WithMany("Interactions") - .HasForeignKey("ProspectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("FoodsharingSiegen.Contracts.Entity.User", "User") - .WithMany("Interactions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Prospect"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b => - { - b.Navigation("Interactions"); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b => - { - b.Navigation("Interactions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/FoodsharingSiegen.Server/Migrations/20220404143914_interalert.cs b/FoodsharingSiegen.Server/Migrations/20220404143914_interalert.cs deleted file mode 100644 index d8b1860..0000000 --- a/FoodsharingSiegen.Server/Migrations/20220404143914_interalert.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace FoodsharingSiegen.Server.Migrations -{ - public partial class interalert : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "Alert", - table: "Interactions", - type: "INTEGER", - nullable: false, - defaultValue: false); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Alert", - table: "Interactions"); - } - } -} diff --git a/FoodsharingSiegen.Server/Migrations/20220405143853_usergroups.Designer.cs b/FoodsharingSiegen.Server/Migrations/20220405143853_usergroups.Designer.cs deleted file mode 100644 index 2195a6c..0000000 --- a/FoodsharingSiegen.Server/Migrations/20220405143853_usergroups.Designer.cs +++ /dev/null @@ -1,178 +0,0 @@ -// -using System; -using FoodsharingSiegen.Server.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace FoodsharingSiegen.Server.Migrations -{ - [DbContext(typeof(FsContext))] - [Migration("20220405143853_usergroups")] - partial class usergroups - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "6.0.1"); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("Alert") - .HasColumnType("INTEGER") - .HasColumnName("Alert"); - - b.Property("Created") - .HasColumnType("TEXT") - .HasColumnName("Created"); - - b.Property("Date") - .HasColumnType("TEXT") - .HasColumnName("Date"); - - b.Property("Info") - .HasColumnType("TEXT") - .HasColumnName("Info"); - - b.Property("NotNeeded") - .HasColumnType("INTEGER") - .HasColumnName("NotNeeded"); - - b.Property("ProspectId") - .HasColumnType("TEXT") - .HasColumnName("ProspectId"); - - b.Property("Type") - .HasColumnType("INTEGER") - .HasColumnName("Type"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("UserId"); - - b.HasKey("Id"); - - b.HasIndex("ProspectId"); - - b.HasIndex("UserId"); - - b.ToTable("Interactions", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("Created") - .HasColumnType("TEXT") - .HasColumnName("Created"); - - b.Property("FsId") - .HasColumnType("INTEGER") - .HasColumnName("FsId"); - - b.Property("Memo") - .HasColumnType("TEXT") - .HasColumnName("Memo"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Name"); - - b.Property("ProgressId") - .HasColumnType("TEXT") - .HasColumnName("ProgressId"); - - b.HasKey("Id"); - - b.ToTable("Prospects", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("Created") - .HasColumnType("TEXT") - .HasColumnName("Created"); - - b.Property("EncryptedPassword") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("EncryptedPassword"); - - b.Property("Groups") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Groups"); - - b.Property("Mail") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Mail"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Name"); - - b.Property("Type") - .HasColumnType("INTEGER") - .HasColumnName("Type"); - - b.Property("Verified") - .HasColumnType("INTEGER") - .HasColumnName("Verified"); - - b.HasKey("Id"); - - b.ToTable("Users", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b => - { - b.HasOne("FoodsharingSiegen.Contracts.Entity.Prospect", "Prospect") - .WithMany("Interactions") - .HasForeignKey("ProspectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("FoodsharingSiegen.Contracts.Entity.User", "User") - .WithMany("Interactions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Prospect"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b => - { - b.Navigation("Interactions"); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b => - { - b.Navigation("Interactions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/FoodsharingSiegen.Server/Migrations/20220405143853_usergroups.cs b/FoodsharingSiegen.Server/Migrations/20220405143853_usergroups.cs deleted file mode 100644 index 9c6264f..0000000 --- a/FoodsharingSiegen.Server/Migrations/20220405143853_usergroups.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace FoodsharingSiegen.Server.Migrations -{ - public partial class usergroups : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "Groups", - table: "Users", - type: "TEXT", - nullable: false, - defaultValue: ""); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Groups", - table: "Users"); - } - } -} diff --git a/FoodsharingSiegen.Server/Migrations/20220411114633_forcelogout.Designer.cs b/FoodsharingSiegen.Server/Migrations/20220411114633_forcelogout.Designer.cs deleted file mode 100644 index 9ca8c00..0000000 --- a/FoodsharingSiegen.Server/Migrations/20220411114633_forcelogout.Designer.cs +++ /dev/null @@ -1,182 +0,0 @@ -// -using System; -using FoodsharingSiegen.Server.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace FoodsharingSiegen.Server.Migrations -{ - [DbContext(typeof(FsContext))] - [Migration("20220411114633_forcelogout")] - partial class forcelogout - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "6.0.1"); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("Alert") - .HasColumnType("INTEGER") - .HasColumnName("Alert"); - - b.Property("Created") - .HasColumnType("TEXT") - .HasColumnName("Created"); - - b.Property("Date") - .HasColumnType("TEXT") - .HasColumnName("Date"); - - b.Property("Info") - .HasColumnType("TEXT") - .HasColumnName("Info"); - - b.Property("NotNeeded") - .HasColumnType("INTEGER") - .HasColumnName("NotNeeded"); - - b.Property("ProspectId") - .HasColumnType("TEXT") - .HasColumnName("ProspectId"); - - b.Property("Type") - .HasColumnType("INTEGER") - .HasColumnName("Type"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("UserId"); - - b.HasKey("Id"); - - b.HasIndex("ProspectId"); - - b.HasIndex("UserId"); - - b.ToTable("Interactions", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("Created") - .HasColumnType("TEXT") - .HasColumnName("Created"); - - b.Property("FsId") - .HasColumnType("INTEGER") - .HasColumnName("FsId"); - - b.Property("Memo") - .HasColumnType("TEXT") - .HasColumnName("Memo"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Name"); - - b.Property("ProgressId") - .HasColumnType("TEXT") - .HasColumnName("ProgressId"); - - b.HasKey("Id"); - - b.ToTable("Prospects", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("Created") - .HasColumnType("TEXT") - .HasColumnName("Created"); - - b.Property("EncryptedPassword") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("EncryptedPassword"); - - b.Property("ForceLogout") - .HasColumnType("INTEGER") - .HasColumnName("ForceLogout"); - - b.Property("Groups") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Groups"); - - b.Property("Mail") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Mail"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Name"); - - b.Property("Type") - .HasColumnType("INTEGER") - .HasColumnName("Type"); - - b.Property("Verified") - .HasColumnType("INTEGER") - .HasColumnName("Verified"); - - b.HasKey("Id"); - - b.ToTable("Users", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b => - { - b.HasOne("FoodsharingSiegen.Contracts.Entity.Prospect", "Prospect") - .WithMany("Interactions") - .HasForeignKey("ProspectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("FoodsharingSiegen.Contracts.Entity.User", "User") - .WithMany("Interactions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Prospect"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b => - { - b.Navigation("Interactions"); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b => - { - b.Navigation("Interactions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/FoodsharingSiegen.Server/Migrations/20220411114633_forcelogout.cs b/FoodsharingSiegen.Server/Migrations/20220411114633_forcelogout.cs deleted file mode 100644 index ab7c78c..0000000 --- a/FoodsharingSiegen.Server/Migrations/20220411114633_forcelogout.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace FoodsharingSiegen.Server.Migrations -{ - public partial class forcelogout : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "ForceLogout", - table: "Users", - type: "INTEGER", - nullable: false, - defaultValue: false); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "ForceLogout", - table: "Users"); - } - } -} diff --git a/FoodsharingSiegen.Server/Migrations/20220401164353_asd.Designer.cs b/FoodsharingSiegen.Server/Migrations/20220521114808_init.Designer.cs similarity index 57% rename from FoodsharingSiegen.Server/Migrations/20220401164353_asd.Designer.cs rename to FoodsharingSiegen.Server/Migrations/20220521114808_init.Designer.cs index 8763d9c..9e4bd9f 100644 --- a/FoodsharingSiegen.Server/Migrations/20220401164353_asd.Designer.cs +++ b/FoodsharingSiegen.Server/Migrations/20220521114808_init.Designer.cs @@ -11,8 +11,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace FoodsharingSiegen.Server.Migrations { [DbContext(typeof(FsContext))] - [Migration("20220401164353_asd")] - partial class asd + [Migration("20220521114808_init")] + partial class init { protected override void BuildTargetModel(ModelBuilder modelBuilder) { @@ -23,112 +23,115 @@ namespace FoodsharingSiegen.Server.Migrations { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); + .HasColumnType("TEXT"); + + b.Property("Alert") + .HasColumnType("INTEGER"); + + b.Property("Created") + .HasColumnType("TEXT"); b.Property("Date") - .HasColumnType("TEXT") - .HasColumnName("Date"); + .HasColumnType("TEXT"); b.Property("Info") - .HasColumnType("TEXT") - .HasColumnName("Info"); + .HasColumnType("TEXT"); - b.Property("ProspectId") - .HasColumnType("TEXT") - .HasColumnName("ProspectId"); + b.Property("NotNeeded") + .HasColumnType("INTEGER"); + + b.Property("ProspectID") + .HasColumnType("TEXT"); b.Property("Type") - .HasColumnType("INTEGER") - .HasColumnName("Type"); + .HasColumnType("INTEGER"); - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("UserId"); + b.Property("UserID") + .HasColumnType("TEXT"); b.HasKey("Id"); - b.HasIndex("ProspectId"); + b.HasIndex("ProspectID"); - b.HasIndex("UserId"); + b.HasIndex("UserID"); - b.ToTable("Interactions", (string)null); + b.ToTable("Interactions"); }); modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); + .HasColumnType("TEXT"); b.Property("Created") - .HasColumnType("TEXT") - .HasColumnName("Created"); + .HasColumnType("TEXT"); b.Property("FsId") - .HasColumnType("INTEGER") - .HasColumnName("FsId"); + .HasColumnType("INTEGER"); + + b.Property("Memo") + .HasColumnType("TEXT"); b.Property("Name") .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Name"); - - b.Property("ProgressId") - .HasColumnType("TEXT") - .HasColumnName("ProgressId"); + .HasColumnType("TEXT"); b.HasKey("Id"); - b.ToTable("Prospects", (string)null); + b.ToTable("Prospects"); }); modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); + .HasColumnType("TEXT"); b.Property("Created") - .HasColumnType("TEXT") - .HasColumnName("Created"); + .HasColumnType("TEXT"); + + b.Property("EncryptedPassword") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ForceLogout") + .HasColumnType("INTEGER"); + + b.Property("Groups") + .IsRequired() + .HasColumnType("TEXT"); b.Property("Mail") .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Mail"); + .HasColumnType("TEXT"); b.Property("Name") .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Name"); + .HasColumnType("TEXT"); b.Property("Type") - .HasColumnType("INTEGER") - .HasColumnName("Type"); + .HasColumnType("INTEGER"); b.Property("Verified") - .HasColumnType("INTEGER") - .HasColumnName("Verified"); + .HasColumnType("INTEGER"); b.HasKey("Id"); - b.ToTable("Users", (string)null); + b.ToTable("Users"); }); modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b => { b.HasOne("FoodsharingSiegen.Contracts.Entity.Prospect", "Prospect") .WithMany("Interactions") - .HasForeignKey("ProspectId") + .HasForeignKey("ProspectID") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("FoodsharingSiegen.Contracts.Entity.User", "User") .WithMany("Interactions") - .HasForeignKey("UserId") + .HasForeignKey("UserID") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); diff --git a/FoodsharingSiegen.Server/Migrations/20220401142848_Init.cs b/FoodsharingSiegen.Server/Migrations/20220521114808_init.cs similarity index 70% rename from FoodsharingSiegen.Server/Migrations/20220401142848_Init.cs rename to FoodsharingSiegen.Server/Migrations/20220521114808_init.cs index a3fc540..148892e 100644 --- a/FoodsharingSiegen.Server/Migrations/20220401142848_Init.cs +++ b/FoodsharingSiegen.Server/Migrations/20220521114808_init.cs @@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore.Migrations; namespace FoodsharingSiegen.Server.Migrations { - public partial class Init : Migration + public partial class init : Migration { protected override void Up(MigrationBuilder migrationBuilder) { @@ -16,7 +16,8 @@ namespace FoodsharingSiegen.Server.Migrations Id = table.Column(type: "TEXT", nullable: false), FsId = table.Column(type: "INTEGER", nullable: false), Name = table.Column(type: "TEXT", nullable: false), - ProgressId = table.Column(type: "TEXT", nullable: false) + Created = table.Column(type: "TEXT", nullable: false), + Memo = table.Column(type: "TEXT", nullable: true) }, constraints: table => { @@ -32,7 +33,10 @@ namespace FoodsharingSiegen.Server.Migrations Type = table.Column(type: "INTEGER", nullable: false), Verified = table.Column(type: "INTEGER", nullable: false), Name = table.Column(type: "TEXT", nullable: false), - Created = table.Column(type: "TEXT", nullable: false) + Created = table.Column(type: "TEXT", nullable: false), + EncryptedPassword = table.Column(type: "TEXT", nullable: false), + Groups = table.Column(type: "TEXT", nullable: false), + ForceLogout = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { @@ -44,37 +48,41 @@ namespace FoodsharingSiegen.Server.Migrations columns: table => new { Id = table.Column(type: "TEXT", nullable: false), + UserID = table.Column(type: "TEXT", nullable: false), Date = table.Column(type: "TEXT", nullable: false), - UserId = table.Column(type: "TEXT", nullable: false), + Info = table.Column(type: "TEXT", nullable: true), Type = table.Column(type: "INTEGER", nullable: false), - ProspectId = table.Column(type: "TEXT", nullable: false) + ProspectID = table.Column(type: "TEXT", nullable: false), + Alert = table.Column(type: "INTEGER", nullable: false), + NotNeeded = table.Column(type: "INTEGER", nullable: false), + Created = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Interactions", x => x.Id); table.ForeignKey( - name: "FK_Interactions_Prospects_ProspectId", - column: x => x.ProspectId, + name: "FK_Interactions_Prospects_ProspectID", + column: x => x.ProspectID, principalTable: "Prospects", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_Interactions_Users_UserId", - column: x => x.UserId, + name: "FK_Interactions_Users_UserID", + column: x => x.UserID, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( - name: "IX_Interactions_ProspectId", + name: "IX_Interactions_ProspectID", table: "Interactions", - column: "ProspectId"); + column: "ProspectID"); migrationBuilder.CreateIndex( - name: "IX_Interactions_UserId", + name: "IX_Interactions_UserID", table: "Interactions", - column: "UserId"); + column: "UserID"); } protected override void Down(MigrationBuilder migrationBuilder) diff --git a/FoodsharingSiegen.Server/Migrations/FsContextModelSnapshot.cs b/FoodsharingSiegen.Server/Migrations/FsContextModelSnapshot.cs index 11dbf03..5e4f5be 100644 --- a/FoodsharingSiegen.Server/Migrations/FsContextModelSnapshot.cs +++ b/FoodsharingSiegen.Server/Migrations/FsContextModelSnapshot.cs @@ -21,142 +21,115 @@ namespace FoodsharingSiegen.Server.Migrations { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); + .HasColumnType("TEXT"); b.Property("Alert") - .HasColumnType("INTEGER") - .HasColumnName("Alert"); + .HasColumnType("INTEGER"); b.Property("Created") - .HasColumnType("TEXT") - .HasColumnName("Created"); + .HasColumnType("TEXT"); b.Property("Date") - .HasColumnType("TEXT") - .HasColumnName("Date"); + .HasColumnType("TEXT"); b.Property("Info") - .HasColumnType("TEXT") - .HasColumnName("Info"); + .HasColumnType("TEXT"); b.Property("NotNeeded") - .HasColumnType("INTEGER") - .HasColumnName("NotNeeded"); + .HasColumnType("INTEGER"); - b.Property("ProspectId") - .HasColumnType("TEXT") - .HasColumnName("ProspectId"); + b.Property("ProspectID") + .HasColumnType("TEXT"); b.Property("Type") - .HasColumnType("INTEGER") - .HasColumnName("Type"); + .HasColumnType("INTEGER"); - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("UserId"); + b.Property("UserID") + .HasColumnType("TEXT"); b.HasKey("Id"); - b.HasIndex("ProspectId"); + b.HasIndex("ProspectID"); - b.HasIndex("UserId"); + b.HasIndex("UserID"); - b.ToTable("Interactions", (string)null); + b.ToTable("Interactions"); }); modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); + .HasColumnType("TEXT"); b.Property("Created") - .HasColumnType("TEXT") - .HasColumnName("Created"); + .HasColumnType("TEXT"); b.Property("FsId") - .HasColumnType("INTEGER") - .HasColumnName("FsId"); + .HasColumnType("INTEGER"); b.Property("Memo") - .HasColumnType("TEXT") - .HasColumnName("Memo"); + .HasColumnType("TEXT"); b.Property("Name") .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Name"); - - b.Property("ProgressId") - .HasColumnType("TEXT") - .HasColumnName("ProgressId"); + .HasColumnType("TEXT"); b.HasKey("Id"); - b.ToTable("Prospects", (string)null); + b.ToTable("Prospects"); }); modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); + .HasColumnType("TEXT"); b.Property("Created") - .HasColumnType("TEXT") - .HasColumnName("Created"); + .HasColumnType("TEXT"); b.Property("EncryptedPassword") .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("EncryptedPassword"); + .HasColumnType("TEXT"); b.Property("ForceLogout") - .HasColumnType("INTEGER") - .HasColumnName("ForceLogout"); + .HasColumnType("INTEGER"); b.Property("Groups") .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Groups"); + .HasColumnType("TEXT"); b.Property("Mail") .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Mail"); + .HasColumnType("TEXT"); b.Property("Name") .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Name"); + .HasColumnType("TEXT"); b.Property("Type") - .HasColumnType("INTEGER") - .HasColumnName("Type"); + .HasColumnType("INTEGER"); b.Property("Verified") - .HasColumnType("INTEGER") - .HasColumnName("Verified"); + .HasColumnType("INTEGER"); b.HasKey("Id"); - b.ToTable("Users", (string)null); + b.ToTable("Users"); }); modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b => { b.HasOne("FoodsharingSiegen.Contracts.Entity.Prospect", "Prospect") .WithMany("Interactions") - .HasForeignKey("ProspectId") + .HasForeignKey("ProspectID") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("FoodsharingSiegen.Contracts.Entity.User", "User") .WithMany("Interactions") - .HasForeignKey("UserId") + .HasForeignKey("UserID") .OnDelete(DeleteBehavior.Cascade) .IsRequired();