Entities vereinfacht (kein Entity Developer mehr)

This commit is contained in:
Andre Beging
2022-05-21 13:56:21 +02:00
parent 21f4906277
commit f23f225098
36 changed files with 416 additions and 2255 deletions

View File

@@ -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
}
}

View File

@@ -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
/// <summary>
/// The interaction class (a. beging, 21.05.2022)
/// </summary>
public class Interaction
{
#region Public Properties
/// <summary>
/// Gets or sets the value of the alert (ab)
/// </summary>
public bool Alert { get; set; }
/// <summary>
/// Gets or sets the value of the created (ab)
/// </summary>
public DateTime Created { get; set; }
/// <summary>
/// Gets or sets the value of the date (ab)
/// </summary>
public DateTime Date { get; set; }
/// <summary>
/// Gets or sets the value of the id (ab)
/// </summary>
[Key] public Guid Id { get; set; }
/// <summary>
/// Gets or sets the value of the info (ab)
/// </summary>
public string? Info { get; set; }
/// <summary>
/// Gets or sets the value of the not needed (ab)
/// </summary>
public bool NotNeeded { get; set; }
/// <summary>
/// Gets or sets the value of the prospect (ab)
/// </summary>
public Prospect Prospect { get; set; }
/// <summary>
/// Gets or sets the value of the prospect id (ab)
/// </summary>
public Guid ProspectID { get; set; }
/// <summary>
/// Gets or sets the value of the type (ab)
/// </summary>
public InteractionType Type { get; set; }
/// <summary>
/// Gets or sets the value of the user (ab)
/// </summary>
public User User { get; set; }
/// <summary>
/// Gets or sets the value of the user id (ab)
/// </summary>
public Guid UserID { get; set; }
#endregion
}
}

View File

@@ -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
{
}
}

View File

@@ -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
{
}
}

View File

@@ -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
{
/// <summary>
/// The interaction type enum
/// </summary>
public enum InteractionType : int
{
/// <summary>
/// The ein ab interaction type
/// </summary>
EinAb = 10,
/// <summary>
/// The welcome interaction type
/// </summary>
Welcome = 20,
/// <summary>
/// The id check interaction type
/// </summary>
IdCheck = 30,
/// <summary>
/// The print pass interaction type
/// </summary>
PrintPass = 40,
/// <summary>
/// The pdf pass interaction type
/// </summary>
PdfPass = 50,
/// <summary>
/// The verify interaction type
/// </summary>
Verify = 60,
/// <summary>
/// The complete interaction type
/// </summary>
Complete = 70
}
}

View File

@@ -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<Interaction>();
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<Interaction> Interactions { get; set; }
#region Extensibility Method Definitions
partial void OnCreated();
#endregion
}
}

View File

@@ -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
/// <summary>
/// The prospect class (a. beging, 21.05.2022)
/// </summary>
public class Prospect
{
public bool Complete => Interactions?.Any(x => x.Type == InteractionType.Complete) == true;
#region Public Properties
/// <summary>
/// Gets the value of the complete (ab)
/// </summary>
[NotMapped] public bool Complete => Interactions?.Any(x => x.Type == InteractionType.Complete) == true;
/// <summary>
/// Gets or sets the value of the created (ab)
/// </summary>
public DateTime Created { get; set; }
/// <summary>
/// Gets or sets the value of the fs id (ab)
/// </summary>
public int FsId { get; set; }
/// <summary>
/// Gets or sets the value of the id (ab)
/// </summary>
[Key] public Guid Id { get; set; }
/// <summary>
/// Gets or sets the value of the interactions (ab)
/// </summary>
public IList<Interaction> Interactions { get; set; }
/// <summary>
/// Gets or sets the value of the memo (ab)
/// </summary>
public string? Memo { get; set; }
/// <summary>
/// Gets or sets the value of the name (ab)
/// </summary>
public string Name { get; set; }
#endregion
}
}

View File

@@ -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<Interaction>();
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<Interaction> Interactions { get; set; }
#region Extensibility Method Definitions
partial void OnCreated();
#endregion
}
}

View File

@@ -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
/// <summary>
/// The user class (a. beging, 06.04.2022)
/// </summary>
public partial class User
public class User
{
#region Public Properties
/// <summary>
/// Gets or sets the value of the created (ab)
/// </summary>
public DateTime Created { get; set; }
/// <summary>
/// Gets or sets the value of the encrypted password (ab)
/// </summary>
public string EncryptedPassword { get; set; }
/// <summary>
/// Gets or sets the value of the force logout (ab)
/// </summary>
public bool ForceLogout { get; set; }
/// <summary>
/// Gets or sets the value of the groups (ab)
/// </summary>
public string Groups { get; set; }
/// <summary>
/// Gets or sets the value of the groups list (ab)
/// </summary>
@@ -27,6 +48,26 @@ namespace FoodsharingSiegen.Contracts.Entity
set => Groups = string.Join(",", value);
}
/// <summary>
/// Gets or sets the value of the id (ab)
/// </summary>
[Key] public Guid Id { get; set; }
/// <summary>
/// Gets or sets the value of the interactions (ab)
/// </summary>
public IList<Interaction> Interactions { get; set; }
/// <summary>
/// Gets or sets the value of the mail (ab)
/// </summary>
public string Mail { get; set; }
/// <summary>
/// Gets or sets the value of the name (ab)
/// </summary>
public string Name { get; set; }
/// <summary>
/// Gets or sets the value of the password (ab)
/// </summary>
@@ -37,6 +78,16 @@ namespace FoodsharingSiegen.Contracts.Entity
set => EncryptedPassword = Cryptor.Encrypt(value);
}
/// <summary>
/// Gets or sets the value of the type (ab)
/// </summary>
public UserType Type { get; set; }
/// <summary>
/// Gets or sets the value of the verified (ab)
/// </summary>
public bool Verified { get; set; }
#endregion
#region Public Method Clone

View File

@@ -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
{
/// <summary>
/// The user group enum
/// </summary>
public enum UserGroup : int
{
/// <summary>
/// The read only user group
/// </summary>
ReadOnly = 100,
/// <summary>
/// The welcome team user group
/// </summary>
WelcomeTeam = 200,
/// <summary>
/// The store manager user group
/// </summary>
StoreManager = 300,
/// <summary>
/// The ambassador user group
/// </summary>
Ambassador = 400
}
}

View File

@@ -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
{
/// <summary>
/// The user type enum
/// </summary>
public enum UserType : int
{
/// <summary>
/// The unverified user type
/// </summary>
Unverified = 100,
/// <summary>
/// The user user type
/// </summary>
User = 200,
/// <summary>
/// The admin user type
/// </summary>
Admin = 300,
nix = 50
}
}