diff --git a/TODO.txt b/TODO.txt index 7153a089b..6d4e54ccf 100644 --- a/TODO.txt +++ b/TODO.txt @@ -12,3 +12,15 @@ T4: Implement soft delete where marked in model DSL: Add bool Enhanced Cascade Delete T4: Implement as CascadeDeleteConvention replacement generating delete triggers + + + +------------------------------------------------------------- +Cascade Delete fixes +------------------------------------------------------------- + + - In EFCore, change WillCascadeOnDelete calls to OnDelete calls + - Property editor should only show cascade delete options on the principal entity + - Update documentation to discuss cascade deletion propagating from principal to dependents ONLY + reference https://docs.microsoft.com/en-us/ef/core/saving/cascade-delete and http://www.entityframeworktutorial.net/code-first/cascade-delete-in-code-first.aspx + diff --git a/changelog.txt b/changelog.txt index 3a524b111..6dbea77bb 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,6 @@ +1.2.6.7 + - An entity's concurrency token property is no longer a required parameter in its constructor (https://github.com/msawczyn/EFDesigner/issues/24). + 1.2.6.6 - Deleting a generalization or superclass gives the choice of pushing attributes and associations down to the former child class(es) diff --git a/src/Dsl/DslDefinition.dsl b/src/Dsl/DslDefinition.dsl index a293f7de9..798234b23 100644 --- a/src/Dsl/DslDefinition.dsl +++ b/src/Dsl/DslDefinition.dsl @@ -1,5 +1,5 @@  - + diff --git a/src/Dsl/GeneratedCode/SerializationHelper.cs b/src/Dsl/GeneratedCode/SerializationHelper.cs index f1b57d514..28aeb2633 100644 --- a/src/Dsl/GeneratedCode/SerializationHelper.cs +++ b/src/Dsl/GeneratedCode/SerializationHelper.cs @@ -1168,7 +1168,7 @@ public virtual void WriteRootElement(DslModeling::SerializationContext serializa // Only model has schema, diagram has no schema. rootElementSettings.SchemaTargetNamespace = "http://schemas.microsoft.com/dsltools/EFModel"; } - rootElementSettings.Version = new global::System.Version("1.2.6.6"); + rootElementSettings.Version = new global::System.Version("1.2.6.7"); // Carry out the normal serialization. rootSerializer.Write(serializationContext, rootElement, writer, rootElementSettings); @@ -1190,7 +1190,7 @@ protected virtual void CheckVersion(DslModeling::SerializationContext serializat throw new global::System.ArgumentNullException("reader"); #endregion - global::System.Version expectedVersion = new global::System.Version("1.2.6.6"); + global::System.Version expectedVersion = new global::System.Version("1.2.6.7"); string dslVersionStr = reader.GetAttribute("dslVersion"); if (dslVersionStr != null) { diff --git a/src/DslPackage/GeneratedCode/Constants.cs b/src/DslPackage/GeneratedCode/Constants.cs index b8d8d3354..852abba67 100644 --- a/src/DslPackage/GeneratedCode/Constants.cs +++ b/src/DslPackage/GeneratedCode/Constants.cs @@ -18,7 +18,7 @@ internal static partial class Constants [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] public const string CompanyName = @"Michael Sawczyn"; [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - public const string ProductVersion = "1.2.6.6"; + public const string ProductVersion = "1.2.6.7"; // Menu definitions public static readonly global::System.ComponentModel.Design.CommandID EFModelDiagramMenu = new global::System.ComponentModel.Design.CommandID(new global::System.Guid(EFModelCommandSetId), 0x10000); diff --git a/src/DslPackage/TextTemplates/EF6Designer.ttinclude b/src/DslPackage/TextTemplates/EF6Designer.ttinclude index 0d1b2f437..44cf6b59b 100644 --- a/src/DslPackage/TextTemplates/EF6Designer.ttinclude +++ b/src/DslPackage/TextTemplates/EF6Designer.ttinclude @@ -7,7 +7,7 @@ #><#@ import namespace="System.IO" #><#@ import namespace="System.Linq" #><#+ -// EFDesigner v1.2.6.6 +// EFDesigner v1.2.6.7 // Copyright (c) 2017-2018 Michael Sawczyn // https://github.com/msawczyn/EFDesigner diff --git a/src/DslPackage/TextTemplates/EFCoreDesigner.ttinclude b/src/DslPackage/TextTemplates/EFCoreDesigner.ttinclude index cb7b89045..b095d90c9 100644 --- a/src/DslPackage/TextTemplates/EFCoreDesigner.ttinclude +++ b/src/DslPackage/TextTemplates/EFCoreDesigner.ttinclude @@ -7,7 +7,7 @@ #><#@ import namespace="System.IO" #><#@ import namespace="System.Linq" #><#+ -// EFDesigner v1.2.6.6 +// EFDesigner v1.2.6.7 // Copyright (c) 2017-2018 Michael Sawczyn // https://github.com/msawczyn/EFDesigner diff --git a/src/DslPackage/TextTemplates/EFDesigner.ttinclude b/src/DslPackage/TextTemplates/EFDesigner.ttinclude index d29b5c488..745dca9f9 100644 --- a/src/DslPackage/TextTemplates/EFDesigner.ttinclude +++ b/src/DslPackage/TextTemplates/EFDesigner.ttinclude @@ -7,7 +7,7 @@ #><#@ import namespace="System.IO" #><#@ import namespace="System.Linq" #><#+ -// EFDesigner v1.2.6.6 +// EFDesigner v1.2.6.7 // Copyright (c) 2017-2018 Michael Sawczyn // https://github.com/msawczyn/EFDesigner @@ -142,6 +142,7 @@ List GetRequiredParameters(ModelClass modelClass, bool? haveDefaults = n { requiredParameters.AddRange(modelClass.AllRequiredAttributes .Where(x => !x.IsIdentity && + !x.IsConcurrencyToken && x.SetterVisibility == SetterAccessModifier.Public && string.IsNullOrEmpty(x.InitialValue)) .Select(x => $"{x.FQPrimitiveType} _{x.Name.ToLower()}")); @@ -153,14 +154,16 @@ List GetRequiredParameters(ModelClass modelClass, bool? haveDefaults = n if (haveDefaults != false) { requiredParameters.AddRange(modelClass.AllRequiredAttributes - .Where(x => !x.IsIdentity && x.SetterVisibility == SetterAccessModifier.Public && - !string.IsNullOrEmpty(x.InitialValue)) - .Select(x => - { - string quote = x.PrimitiveType == "string" ? "\"" : x.PrimitiveType == "char" ? "'" : ""; - string value = FullyQualified(modelClass.ModelRoot, x.InitialValue.Trim('"', '\'')); - return $"{x.FQPrimitiveType} _{x.Name.ToLower()} = {quote}{value}{quote}"; - })); + .Where(x => !x.IsIdentity && + !x.IsConcurrencyToken && + x.SetterVisibility == SetterAccessModifier.Public && + !string.IsNullOrEmpty(x.InitialValue)) + .Select(x => + { + string quote = x.PrimitiveType == "string" ? "\"" : x.PrimitiveType == "char" ? "'" : ""; + string value = FullyQualified(modelClass.ModelRoot, x.InitialValue.Trim('"', '\'')); + return $"{x.FQPrimitiveType} _{x.Name.ToLower()} = {quote}{value}{quote}"; + })); } return requiredParameters; @@ -169,8 +172,7 @@ List GetRequiredParameters(ModelClass modelClass, bool? haveDefaults = n List GetRequiredParameterNames(ModelClass modelClass) { List requiredParameterNames = modelClass.AllRequiredAttributes - .Where(x => !x.IsIdentity && x.SetterVisibility == SetterAccessModifier.Public && - string.IsNullOrEmpty(x.InitialValue)) + .Where(x => !x.IsIdentity && !x.IsConcurrencyToken && x.SetterVisibility == SetterAccessModifier.Public && string.IsNullOrEmpty(x.InitialValue)) .Select(x => $"_{x.Name.ToLower().Trim('_')}") .ToList(); @@ -178,8 +180,7 @@ List GetRequiredParameterNames(ModelClass modelClass) .Select(x => $"_{x.PropertyName.ToLower().Trim('_')}")); requiredParameterNames.AddRange(modelClass.AllRequiredAttributes - .Where(x => !x.IsIdentity && x.SetterVisibility == SetterAccessModifier.Public && - !string.IsNullOrEmpty(x.InitialValue)) + .Where(x => !x.IsIdentity && !x.IsConcurrencyToken && x.SetterVisibility == SetterAccessModifier.Public && !string.IsNullOrEmpty(x.InitialValue)) .Select(x => $"_{x.Name.ToLower().Trim('_')}")); return requiredParameterNames; diff --git a/src/DslPackage/TextTemplates/MultipleOutputHelper.ttinclude b/src/DslPackage/TextTemplates/MultipleOutputHelper.ttinclude index bdcc1fb19..25096738d 100644 --- a/src/DslPackage/TextTemplates/MultipleOutputHelper.ttinclude +++ b/src/DslPackage/TextTemplates/MultipleOutputHelper.ttinclude @@ -9,7 +9,7 @@ #><#@ import namespace="Microsoft.VisualStudio.TextTemplating" #><#+ -// EFDesigner v1.2.6.6 +// EFDesigner v1.2.6.7 // Copyright (c) 2017-2018 Michael Sawczyn // https://github.com/msawczyn/EFDesigner // diff --git a/src/DslPackage/TextTemplates/VSIntegration.ttinclude b/src/DslPackage/TextTemplates/VSIntegration.ttinclude index 1e62fb3a2..d5d9eab82 100644 --- a/src/DslPackage/TextTemplates/VSIntegration.ttinclude +++ b/src/DslPackage/TextTemplates/VSIntegration.ttinclude @@ -10,7 +10,7 @@ #><#@ import namespace="Microsoft.VisualStudio.TextTemplating" #><#+ - // EFDesigner v1.2.6.6 + // EFDesigner v1.2.6.7 // https://github.com/msawczyn/EFDesigner // this bit is thanks to Simon Hughes and his EntityFramework Reverse POCO Code First Generator diff --git a/src/DslPackage/source.extension.vsixmanifest b/src/DslPackage/source.extension.vsixmanifest index 0975c5c8c..cbe426737 100644 --- a/src/DslPackage/source.extension.vsixmanifest +++ b/src/DslPackage/source.extension.vsixmanifest @@ -1,7 +1,7 @@  - + Entity Framework Visual Editor Entity Framework visual editor for EF6, EFCore and beyond. Logo.ico diff --git a/src/Testing/Testing_CoreV2/Generated/Context/AllFeatureModel.generated.cs b/src/Testing/Testing_CoreV2/Generated/Context/AllFeatureModel.generated.cs new file mode 100644 index 000000000..379da85f1 --- /dev/null +++ b/src/Testing/Testing_CoreV2/Generated/Context/AllFeatureModel.generated.cs @@ -0,0 +1,176 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; + +namespace Testing +{ + /// + public partial class AllFeatureModel : Microsoft.EntityFrameworkCore.DbContext + { + #region DbSets + public Microsoft.EntityFrameworkCore.DbSet AbstractBaseClasses { get; set; } + public Microsoft.EntityFrameworkCore.DbSet AllPropertyTypesOptionals { get; set; } + public Microsoft.EntityFrameworkCore.DbSet AllPropertyTypesRequireds { get; set; } + public Microsoft.EntityFrameworkCore.DbSet BaseClasses { get; set; } + public Microsoft.EntityFrameworkCore.DbSet BaseClassWithRequiredProperties { get; set; } + public Microsoft.EntityFrameworkCore.DbSet BChilds { get; set; } + public Microsoft.EntityFrameworkCore.DbSet BParentCollections { get; set; } + public Microsoft.EntityFrameworkCore.DbSet BParentOptionals { get; set; } + public Microsoft.EntityFrameworkCore.DbSet BParentRequireds { get; set; } + public Microsoft.EntityFrameworkCore.DbSet Children { get; set; } + public Microsoft.EntityFrameworkCore.DbSet ConcreteDerivedClasses { get; set; } + public Microsoft.EntityFrameworkCore.DbSet ConcreteDerivedClassWithRequiredProperties { get; set; } + public Microsoft.EntityFrameworkCore.DbSet DerivedClasses { get; set; } + public Microsoft.EntityFrameworkCore.DbSet HiddenEntities { get; set; } + public Microsoft.EntityFrameworkCore.DbSet Masters { get; set; } + public Microsoft.EntityFrameworkCore.DbSet ParserTests { get; set; } + public Microsoft.EntityFrameworkCore.DbSet RenamedColumns { get; set; } + public Microsoft.EntityFrameworkCore.DbSet UChilds { get; set; } + public Microsoft.EntityFrameworkCore.DbSet UParentCollections { get; set; } + public Microsoft.EntityFrameworkCore.DbSet UParentOptionals { get; set; } + public Microsoft.EntityFrameworkCore.DbSet UParentRequireds { get; set; } + #endregion DbSets + + /// + /// Default connection string + /// + public static string ConnectionString { get; set; } = @"Data Source=.\sqlexpress;Initial Catalog=Test;Integrated Security=True"; + + /// + public AllFeatureModel() : base() + { + } + + /// + public AllFeatureModel(DbContextOptions options) : base(options) + { + } + + partial void CustomInit(DbContextOptionsBuilder optionsBuilder); + + /// + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + CustomInit(optionsBuilder); + } + + partial void OnModelCreatingImpl(ModelBuilder modelBuilder); + partial void OnModelCreatedImpl(ModelBuilder modelBuilder); + + /// + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + OnModelCreatingImpl(modelBuilder); + + modelBuilder.HasDefaultSchema("dbo"); + + + modelBuilder.Entity().ToTable("AllPropertyTypesOptionals").HasKey(t => t.Id); + modelBuilder.Entity().Property(t => t.Id).IsRequired().ValueGeneratedOnAdd(); + modelBuilder.Entity().Property(t => t.StringAttr).HasMaxLength(10); + + modelBuilder.Entity().ToTable("AllPropertyTypesRequireds").HasKey(t => t.Id); + modelBuilder.Entity().Property(t => t.Id).IsRequired().ValueGeneratedOnAdd(); + modelBuilder.Entity().Property(t => t.BinaryAttr).IsRequired(); + modelBuilder.Entity().Property(t => t.BooleanAttr).IsRequired(); + modelBuilder.Entity().Property(t => t.ByteAttr).IsRequired(); + modelBuilder.Entity().Property(t => t.DateTimeAttr).IsRequired(); + modelBuilder.Entity().Property(t => t.DateTimeOffsetAttr).IsRequired(); + modelBuilder.Entity().Property(t => t.DecimalAttr).IsRequired(); + modelBuilder.Entity().Property(t => t.DoubleAttr).IsRequired(); + modelBuilder.Entity().Property(t => t.GuidAttr).IsRequired(); + modelBuilder.Entity().Property(t => t.Int16Attr).IsRequired(); + modelBuilder.Entity().Property(t => t.Int32Attr).IsRequired(); + modelBuilder.Entity().Property(t => t.Int64Attr).IsRequired(); + modelBuilder.Entity().Property(t => t.SingleAttr).IsRequired(); + modelBuilder.Entity().Property(t => t.StringAttr).HasMaxLength(10).IsRequired(); + modelBuilder.Entity().Property(t => t.TimeAttr).IsRequired(); + + + modelBuilder.Entity().ToTable("BaseClassWithRequiredProperties").HasKey(t => t.Id); + modelBuilder.Entity().Property(t => t.Id).IsRequired().ValueGeneratedOnAdd(); + modelBuilder.Entity().Property(t => t.Property0).IsRequired(); + + modelBuilder.Entity().ToTable("BChilds").HasKey(t => t.Id); + modelBuilder.Entity().Property(t => t.Id).IsRequired().ValueGeneratedOnAdd(); + modelBuilder.Entity().HasOne(x => x.BParentRequired).WithOne(x => x.BChildOptional); + modelBuilder.Entity().HasOne(x => x.BParentRequired_1).WithOne(x => x.BChildRequired).IsRequired(); + modelBuilder.Entity().HasOne(x => x.BParentRequired_2).WithMany(x => x.BChildCollection); + modelBuilder.Entity().HasMany(x => x.BParentCollection).WithOne(x => x.BChildRequired).HasForeignKey("BChildRequired_Id").IsRequired(); + modelBuilder.Entity().HasMany(x => x.BParentCollection_2).WithOne(x => x.BChildOptional).HasForeignKey("BChildOptional_Id"); + modelBuilder.Entity().HasOne(x => x.BParentOptional).WithOne(x => x.BChildRequired).HasForeignKey("BChildRequired1_Id").IsRequired(); + modelBuilder.Entity().HasOne(x => x.BParentOptional_1).WithMany(x => x.BChildCollection); + modelBuilder.Entity().HasOne(x => x.BParentOptional_2).WithOne(x => x.BChildOptional); + + modelBuilder.Entity().ToTable("BParentCollections").HasKey(t => t.Id); + modelBuilder.Entity().Property(t => t.Id).IsRequired().ValueGeneratedOnAdd(); + + modelBuilder.Entity().ToTable("BParentOptionals").HasKey(t => t.Id); + modelBuilder.Entity().Property(t => t.Id).IsRequired().ValueGeneratedOnAdd(); + + modelBuilder.Entity().ToTable("BParentRequireds").HasKey(t => t.Id); + modelBuilder.Entity().Property(t => t.Id).IsRequired().ValueGeneratedOnAdd(); + + modelBuilder.Entity().ToTable("Children").HasKey(t => t.Id); + modelBuilder.Entity().Property(t => t.Id).IsRequired().ValueGeneratedOnAdd(); + modelBuilder.Entity().HasOne(x => x.Parent).WithMany(x => x.Children); + + + modelBuilder.Entity().Property(t => t.Property1).IsRequired(); + + + modelBuilder.Entity().ToTable("HiddenEntities").HasKey(t => t.Id); + modelBuilder.Entity().Property(t => t.Id).IsRequired().ValueGeneratedOnAdd(); + + modelBuilder.Entity().ToTable("Masters").HasKey(t => t.Id); + modelBuilder.Entity().Property(t => t.Id).IsRequired().ValueGeneratedOnAdd(); + modelBuilder.Entity().HasMany(x => x.Children).WithOne().IsRequired(); + + modelBuilder.Entity().ToTable("ParserTests").HasKey(t => t.Id); + modelBuilder.Entity().Property(t => t.Id).IsRequired().ValueGeneratedOnAdd(); + modelBuilder.Entity().Property(t => t.name7).HasMaxLength(6); + modelBuilder.Entity().Property(t => t.name8).HasMaxLength(6); + modelBuilder.Entity().Property(t => t.name9).HasMaxLength(6); + modelBuilder.Entity().Property(t => t.name).HasMaxLength(6); + modelBuilder.Entity().Property(t => t.name15).HasMaxLength(6); + modelBuilder.Entity().Property(t => t.name16).HasMaxLength(6); + modelBuilder.Entity().Property(t => t.name17).HasMaxLength(6); + modelBuilder.Entity().Property(t => t.name18).HasMaxLength(6); + + modelBuilder.Entity().ToTable("RenamedColumns").HasKey(t => t.Id); + modelBuilder.Entity().Property(t => t.Id).IsRequired().HasColumnName("Foo").ValueGeneratedOnAdd(); + + modelBuilder.Entity().ToTable("UChilds").HasKey(t => t.Id); + modelBuilder.Entity().Property(t => t.Id).IsRequired().ValueGeneratedOnAdd(); + + modelBuilder.Entity().ToTable("UParentCollections").HasKey(t => t.Id); + modelBuilder.Entity().Property(t => t.Id).IsRequired().ValueGeneratedOnAdd(); + modelBuilder.Entity().HasOne(x => x.UChildRequired).WithMany().HasForeignKey("UChildRequired_Id"); + modelBuilder.Entity().HasOne(x => x.UChildOptional).WithMany().HasForeignKey("UChildOptional_Id"); + + modelBuilder.Entity().HasOne(x => x.UChildOptional).WithOne(); + modelBuilder.Entity().HasMany(x => x.UChildCollection).WithOne(); + modelBuilder.Entity().HasOne(x => x.UChildRequired).WithOne().HasForeignKey("UChildRequired_Id"); + + modelBuilder.Entity().ToTable("UParentRequireds").HasKey(t => t.Id); + modelBuilder.Entity().Property(t => t.Id).IsRequired().ValueGeneratedOnAdd(); + modelBuilder.Entity().HasOne(x => x.UChildRequired).WithOne().IsRequired(); + modelBuilder.Entity().HasMany(x => x.UChildCollection).WithOne().IsRequired(); + modelBuilder.Entity().HasOne(x => x.UChildOptional).WithOne().IsRequired(); + + OnModelCreatedImpl(modelBuilder); + } + } +} diff --git a/src/Testing/Testing_CoreV2/Generated/Entities/AbstractBaseClass.generated.cs b/src/Testing/Testing_CoreV2/Generated/Entities/AbstractBaseClass.generated.cs new file mode 100644 index 000000000..72a33c46b --- /dev/null +++ b/src/Testing/Testing_CoreV2/Generated/Entities/AbstractBaseClass.generated.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Testing +{ + public abstract partial class AbstractBaseClass : Testing.BaseClassWithRequiredProperties, INotifyPropertyChanged + { + partial void Init(); + + /// + /// Default constructor. Protected due to being abstract. + /// + protected AbstractBaseClass(): base() + { + Init(); + } + + /// + /// Public constructor with required data + /// + /// + protected AbstractBaseClass(string _property0) + { + if (string.IsNullOrEmpty(_property0)) throw new ArgumentNullException(nameof(_property0)); + Property0 = _property0; + Init(); + } + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + } +} + diff --git a/src/Testing/Testing_CoreV2/Generated/Entities/AllPropertyTypesOptional.generated.cs b/src/Testing/Testing_CoreV2/Generated/Entities/AllPropertyTypesOptional.generated.cs new file mode 100644 index 000000000..4dda57f61 --- /dev/null +++ b/src/Testing/Testing_CoreV2/Generated/Entities/AllPropertyTypesOptional.generated.cs @@ -0,0 +1,203 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Testing +{ + public partial class AllPropertyTypesOptional : INotifyPropertyChanged + { + partial void Init(); + + /// + /// Default constructor + /// + public AllPropertyTypesOptional() + { + Init(); + } + + // Persistent properties + + [Key] + [Required] + protected int _Id; + partial void SetId(int oldValue, ref int newValue); + partial void GetId(ref int result); + + /// + /// Identity, Required, Indexed + /// + public int Id + { + get { int value = _Id; GetId(ref value); return (_Id = value); } + set { int oldValue = _Id; SetId(oldValue, ref value); _Id = value; OnPropertyChanged(); } + } + + protected byte[] _BinaryAttr; + partial void SetBinaryAttr(byte[] oldValue, ref byte[] newValue); + partial void GetBinaryAttr(ref byte[] result); + + public byte[] BinaryAttr + { + get { byte[] value = _BinaryAttr; GetBinaryAttr(ref value); return (_BinaryAttr = value); } + set { byte[] oldValue = _BinaryAttr; SetBinaryAttr(oldValue, ref value); _BinaryAttr = value; OnPropertyChanged(); } + } + + protected bool? _BooleanAttr; + partial void SetBooleanAttr(bool? oldValue, ref bool? newValue); + partial void GetBooleanAttr(ref bool? result); + + public bool? BooleanAttr + { + get { bool? value = _BooleanAttr; GetBooleanAttr(ref value); return (_BooleanAttr = value); } + set { bool? oldValue = _BooleanAttr; SetBooleanAttr(oldValue, ref value); _BooleanAttr = value; OnPropertyChanged(); } + } + + protected byte? _ByteAttr; + partial void SetByteAttr(byte? oldValue, ref byte? newValue); + partial void GetByteAttr(ref byte? result); + + public byte? ByteAttr + { + get { byte? value = _ByteAttr; GetByteAttr(ref value); return (_ByteAttr = value); } + set { byte? oldValue = _ByteAttr; SetByteAttr(oldValue, ref value); _ByteAttr = value; OnPropertyChanged(); } + } + + protected DateTime? _DateTimeAttr; + partial void SetDateTimeAttr(DateTime? oldValue, ref DateTime? newValue); + partial void GetDateTimeAttr(ref DateTime? result); + + public DateTime? DateTimeAttr + { + get { DateTime? value = _DateTimeAttr; GetDateTimeAttr(ref value); return (_DateTimeAttr = value); } + set { DateTime? oldValue = _DateTimeAttr; SetDateTimeAttr(oldValue, ref value); _DateTimeAttr = value; OnPropertyChanged(); } + } + + protected DateTimeOffset? _DateTimeOffsetAttr; + partial void SetDateTimeOffsetAttr(DateTimeOffset? oldValue, ref DateTimeOffset? newValue); + partial void GetDateTimeOffsetAttr(ref DateTimeOffset? result); + + public DateTimeOffset? DateTimeOffsetAttr + { + get { DateTimeOffset? value = _DateTimeOffsetAttr; GetDateTimeOffsetAttr(ref value); return (_DateTimeOffsetAttr = value); } + set { DateTimeOffset? oldValue = _DateTimeOffsetAttr; SetDateTimeOffsetAttr(oldValue, ref value); _DateTimeOffsetAttr = value; OnPropertyChanged(); } + } + + protected decimal? _DecimalAttr; + partial void SetDecimalAttr(decimal? oldValue, ref decimal? newValue); + partial void GetDecimalAttr(ref decimal? result); + + public decimal? DecimalAttr + { + get { decimal? value = _DecimalAttr; GetDecimalAttr(ref value); return (_DecimalAttr = value); } + set { decimal? oldValue = _DecimalAttr; SetDecimalAttr(oldValue, ref value); _DecimalAttr = value; OnPropertyChanged(); } + } + + protected double? _DoubleAttr; + partial void SetDoubleAttr(double? oldValue, ref double? newValue); + partial void GetDoubleAttr(ref double? result); + + public double? DoubleAttr + { + get { double? value = _DoubleAttr; GetDoubleAttr(ref value); return (_DoubleAttr = value); } + set { double? oldValue = _DoubleAttr; SetDoubleAttr(oldValue, ref value); _DoubleAttr = value; OnPropertyChanged(); } + } + + protected Guid? _GuidAttr; + partial void SetGuidAttr(Guid? oldValue, ref Guid? newValue); + partial void GetGuidAttr(ref Guid? result); + + public Guid? GuidAttr + { + get { Guid? value = _GuidAttr; GetGuidAttr(ref value); return (_GuidAttr = value); } + set { Guid? oldValue = _GuidAttr; SetGuidAttr(oldValue, ref value); _GuidAttr = value; OnPropertyChanged(); } + } + + protected short? _Int16Attr; + partial void SetInt16Attr(short? oldValue, ref short? newValue); + partial void GetInt16Attr(ref short? result); + + public short? Int16Attr + { + get { short? value = _Int16Attr; GetInt16Attr(ref value); return (_Int16Attr = value); } + set { short? oldValue = _Int16Attr; SetInt16Attr(oldValue, ref value); _Int16Attr = value; OnPropertyChanged(); } + } + + protected int? _Int32Attr; + partial void SetInt32Attr(int? oldValue, ref int? newValue); + partial void GetInt32Attr(ref int? result); + + public int? Int32Attr + { + get { int? value = _Int32Attr; GetInt32Attr(ref value); return (_Int32Attr = value); } + set { int? oldValue = _Int32Attr; SetInt32Attr(oldValue, ref value); _Int32Attr = value; OnPropertyChanged(); } + } + + protected long? _Int64Attr; + partial void SetInt64Attr(long? oldValue, ref long? newValue); + partial void GetInt64Attr(ref long? result); + + public long? Int64Attr + { + get { long? value = _Int64Attr; GetInt64Attr(ref value); return (_Int64Attr = value); } + set { long? oldValue = _Int64Attr; SetInt64Attr(oldValue, ref value); _Int64Attr = value; OnPropertyChanged(); } + } + + protected Single? _SingleAttr; + partial void SetSingleAttr(Single? oldValue, ref Single? newValue); + partial void GetSingleAttr(ref Single? result); + + public Single? SingleAttr + { + get { Single? value = _SingleAttr; GetSingleAttr(ref value); return (_SingleAttr = value); } + set { Single? oldValue = _SingleAttr; SetSingleAttr(oldValue, ref value); _SingleAttr = value; OnPropertyChanged(); } + } + + [MaxLength(10)] + protected string _StringAttr; + partial void SetStringAttr(string oldValue, ref string newValue); + partial void GetStringAttr(ref string result); + + /// + /// Min length = 1, Max length = 10 + /// + public string StringAttr + { + get { string value = _StringAttr; GetStringAttr(ref value); return (_StringAttr = value); } + set { string oldValue = _StringAttr; SetStringAttr(oldValue, ref value); _StringAttr = value; OnPropertyChanged(); } + } + + protected TimeSpan? _TimeAttr; + partial void SetTimeAttr(TimeSpan? oldValue, ref TimeSpan? newValue); + partial void GetTimeAttr(ref TimeSpan? result); + + public TimeSpan? TimeAttr + { + get { TimeSpan? value = _TimeAttr; GetTimeAttr(ref value); return (_TimeAttr = value); } + set { TimeSpan? oldValue = _TimeAttr; SetTimeAttr(oldValue, ref value); _TimeAttr = value; OnPropertyChanged(); } + } + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + } +} + diff --git a/src/Testing/Testing_CoreV2/Generated/Entities/AllPropertyTypesRequired.generated.cs b/src/Testing/Testing_CoreV2/Generated/Entities/AllPropertyTypesRequired.generated.cs new file mode 100644 index 000000000..8524064d5 --- /dev/null +++ b/src/Testing/Testing_CoreV2/Generated/Entities/AllPropertyTypesRequired.generated.cs @@ -0,0 +1,315 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Testing +{ + public partial class AllPropertyTypesRequired : INotifyPropertyChanged + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected AllPropertyTypesRequired() + { + Init(); + } + + /// + /// Public constructor with required data + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public AllPropertyTypesRequired(byte[] _binaryattr, bool _booleanattr, byte _byteattr, DateTime _datetimeattr, DateTimeOffset _datetimeoffsetattr, decimal _decimalattr, double _doubleattr, Guid _guidattr, short _int16attr, int _int32attr, long _int64attr, Single _singleattr, string _stringattr, TimeSpan _timeattr) + { + BinaryAttr = _binaryattr; + BooleanAttr = _booleanattr; + ByteAttr = _byteattr; + DateTimeAttr = _datetimeattr; + DateTimeOffsetAttr = _datetimeoffsetattr; + DecimalAttr = _decimalattr; + DoubleAttr = _doubleattr; + GuidAttr = _guidattr; + Int16Attr = _int16attr; + Int32Attr = _int32attr; + Int64Attr = _int64attr; + SingleAttr = _singleattr; + if (string.IsNullOrEmpty(_stringattr)) throw new ArgumentNullException(nameof(_stringattr)); + StringAttr = _stringattr; + TimeAttr = _timeattr; + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static AllPropertyTypesRequired Create(byte[] _binaryattr, bool _booleanattr, byte _byteattr, DateTime _datetimeattr, DateTimeOffset _datetimeoffsetattr, decimal _decimalattr, double _doubleattr, Guid _guidattr, short _int16attr, int _int32attr, long _int64attr, Single _singleattr, string _stringattr, TimeSpan _timeattr) + { + return new AllPropertyTypesRequired(_binaryattr, _booleanattr, _byteattr, _datetimeattr, _datetimeoffsetattr, _decimalattr, _doubleattr, _guidattr, _int16attr, _int32attr, _int64attr, _singleattr, _stringattr, _timeattr); + } + + // Persistent properties + + [Key] + [Required] + protected int _Id; + partial void SetId(int oldValue, ref int newValue); + partial void GetId(ref int result); + + /// + /// Identity, Required, Indexed + /// + public int Id + { + get { int value = _Id; GetId(ref value); return (_Id = value); } + set { int oldValue = _Id; SetId(oldValue, ref value); _Id = value; OnPropertyChanged(); } + } + + [Required] + protected byte[] _BinaryAttr; + partial void SetBinaryAttr(byte[] oldValue, ref byte[] newValue); + partial void GetBinaryAttr(ref byte[] result); + + /// + /// Required + /// + public byte[] BinaryAttr + { + get { byte[] value = _BinaryAttr; GetBinaryAttr(ref value); return (_BinaryAttr = value); } + set { byte[] oldValue = _BinaryAttr; SetBinaryAttr(oldValue, ref value); _BinaryAttr = value; OnPropertyChanged(); } + } + + [Required] + protected bool _BooleanAttr; + partial void SetBooleanAttr(bool oldValue, ref bool newValue); + partial void GetBooleanAttr(ref bool result); + + /// + /// Required + /// + public bool BooleanAttr + { + get { bool value = _BooleanAttr; GetBooleanAttr(ref value); return (_BooleanAttr = value); } + set { bool oldValue = _BooleanAttr; SetBooleanAttr(oldValue, ref value); _BooleanAttr = value; OnPropertyChanged(); } + } + + [Required] + protected byte _ByteAttr; + partial void SetByteAttr(byte oldValue, ref byte newValue); + partial void GetByteAttr(ref byte result); + + /// + /// Required + /// + public byte ByteAttr + { + get { byte value = _ByteAttr; GetByteAttr(ref value); return (_ByteAttr = value); } + set { byte oldValue = _ByteAttr; SetByteAttr(oldValue, ref value); _ByteAttr = value; OnPropertyChanged(); } + } + + [Required] + protected DateTime _DateTimeAttr; + partial void SetDateTimeAttr(DateTime oldValue, ref DateTime newValue); + partial void GetDateTimeAttr(ref DateTime result); + + /// + /// Required + /// + public DateTime DateTimeAttr + { + get { DateTime value = _DateTimeAttr; GetDateTimeAttr(ref value); return (_DateTimeAttr = value); } + set { DateTime oldValue = _DateTimeAttr; SetDateTimeAttr(oldValue, ref value); _DateTimeAttr = value; OnPropertyChanged(); } + } + + [Required] + protected DateTimeOffset _DateTimeOffsetAttr; + partial void SetDateTimeOffsetAttr(DateTimeOffset oldValue, ref DateTimeOffset newValue); + partial void GetDateTimeOffsetAttr(ref DateTimeOffset result); + + /// + /// Required + /// + public DateTimeOffset DateTimeOffsetAttr + { + get { DateTimeOffset value = _DateTimeOffsetAttr; GetDateTimeOffsetAttr(ref value); return (_DateTimeOffsetAttr = value); } + set { DateTimeOffset oldValue = _DateTimeOffsetAttr; SetDateTimeOffsetAttr(oldValue, ref value); _DateTimeOffsetAttr = value; OnPropertyChanged(); } + } + + [Required] + protected decimal _DecimalAttr; + partial void SetDecimalAttr(decimal oldValue, ref decimal newValue); + partial void GetDecimalAttr(ref decimal result); + + /// + /// Required + /// + public decimal DecimalAttr + { + get { decimal value = _DecimalAttr; GetDecimalAttr(ref value); return (_DecimalAttr = value); } + set { decimal oldValue = _DecimalAttr; SetDecimalAttr(oldValue, ref value); _DecimalAttr = value; OnPropertyChanged(); } + } + + [Required] + protected double _DoubleAttr; + partial void SetDoubleAttr(double oldValue, ref double newValue); + partial void GetDoubleAttr(ref double result); + + /// + /// Required + /// + public double DoubleAttr + { + get { double value = _DoubleAttr; GetDoubleAttr(ref value); return (_DoubleAttr = value); } + set { double oldValue = _DoubleAttr; SetDoubleAttr(oldValue, ref value); _DoubleAttr = value; OnPropertyChanged(); } + } + + [Required] + protected Guid _GuidAttr; + partial void SetGuidAttr(Guid oldValue, ref Guid newValue); + partial void GetGuidAttr(ref Guid result); + + /// + /// Required + /// + public Guid GuidAttr + { + get { Guid value = _GuidAttr; GetGuidAttr(ref value); return (_GuidAttr = value); } + set { Guid oldValue = _GuidAttr; SetGuidAttr(oldValue, ref value); _GuidAttr = value; OnPropertyChanged(); } + } + + [Required] + protected short _Int16Attr; + partial void SetInt16Attr(short oldValue, ref short newValue); + partial void GetInt16Attr(ref short result); + + /// + /// Required + /// + public short Int16Attr + { + get { short value = _Int16Attr; GetInt16Attr(ref value); return (_Int16Attr = value); } + set { short oldValue = _Int16Attr; SetInt16Attr(oldValue, ref value); _Int16Attr = value; OnPropertyChanged(); } + } + + [Required] + protected int _Int32Attr; + partial void SetInt32Attr(int oldValue, ref int newValue); + partial void GetInt32Attr(ref int result); + + /// + /// Required + /// + public int Int32Attr + { + get { int value = _Int32Attr; GetInt32Attr(ref value); return (_Int32Attr = value); } + set { int oldValue = _Int32Attr; SetInt32Attr(oldValue, ref value); _Int32Attr = value; OnPropertyChanged(); } + } + + [Required] + protected long _Int64Attr; + partial void SetInt64Attr(long oldValue, ref long newValue); + partial void GetInt64Attr(ref long result); + + /// + /// Required + /// + public long Int64Attr + { + get { long value = _Int64Attr; GetInt64Attr(ref value); return (_Int64Attr = value); } + set { long oldValue = _Int64Attr; SetInt64Attr(oldValue, ref value); _Int64Attr = value; OnPropertyChanged(); } + } + + [Required] + protected Single _SingleAttr; + partial void SetSingleAttr(Single oldValue, ref Single newValue); + partial void GetSingleAttr(ref Single result); + + /// + /// Required + /// + public Single SingleAttr + { + get { Single value = _SingleAttr; GetSingleAttr(ref value); return (_SingleAttr = value); } + set { Single oldValue = _SingleAttr; SetSingleAttr(oldValue, ref value); _SingleAttr = value; OnPropertyChanged(); } + } + + [Required] + [MaxLength(10)] + protected string _StringAttr; + partial void SetStringAttr(string oldValue, ref string newValue); + partial void GetStringAttr(ref string result); + + /// + /// Required, Min length = 1, Max length = 10 + /// + public string StringAttr + { + get { string value = _StringAttr; GetStringAttr(ref value); return (_StringAttr = value); } + set { string oldValue = _StringAttr; SetStringAttr(oldValue, ref value); _StringAttr = value; OnPropertyChanged(); } + } + + [Required] + protected TimeSpan _TimeAttr; + partial void SetTimeAttr(TimeSpan oldValue, ref TimeSpan newValue); + partial void GetTimeAttr(ref TimeSpan result); + + /// + /// Required + /// + public TimeSpan TimeAttr + { + get { TimeSpan value = _TimeAttr; GetTimeAttr(ref value); return (_TimeAttr = value); } + set { TimeSpan oldValue = _TimeAttr; SetTimeAttr(oldValue, ref value); _TimeAttr = value; OnPropertyChanged(); } + } + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + } +} + diff --git a/src/Testing/Testing_CoreV2/Generated/Entities/BChild.generated.cs b/src/Testing/Testing_CoreV2/Generated/Entities/BChild.generated.cs new file mode 100644 index 000000000..54324495f --- /dev/null +++ b/src/Testing/Testing_CoreV2/Generated/Entities/BChild.generated.cs @@ -0,0 +1,114 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Testing +{ + public partial class BChild : INotifyPropertyChanged + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected BChild() + { + BParentCollection = new System.Collections.Generic.HashSet(); + BParentCollection_2 = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Public constructor with required data + /// + /// + /// + /// + public BChild(Testing.BParentRequired _bparentrequired, Testing.BParentRequired _bparentrequired_1, Testing.BParentRequired _bparentrequired_2) + { + if (_bparentrequired == null) throw new ArgumentNullException(nameof(_bparentrequired)); + BParentRequired = _bparentrequired; + + if (_bparentrequired_1 == null) throw new ArgumentNullException(nameof(_bparentrequired_1)); + BParentRequired_1 = _bparentrequired_1; + + if (_bparentrequired_2 == null) throw new ArgumentNullException(nameof(_bparentrequired_2)); + BParentRequired_2 = _bparentrequired_2; + + BParentCollection = new HashSet(); + BParentCollection_2 = new HashSet(); + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + /// + /// + public static BChild Create(Testing.BParentRequired _bparentrequired, Testing.BParentRequired _bparentrequired_1, Testing.BParentRequired _bparentrequired_2) + { + return new BChild(_bparentrequired, _bparentrequired_1, _bparentrequired_2); + } + + // Persistent properties + + [Key] + [Required] + protected int _Id; + partial void SetId(int oldValue, ref int newValue); + partial void GetId(ref int result); + + /// + /// Identity, Required, Indexed + /// + public int Id + { + get { int value = _Id; GetId(ref value); return (_Id = value); } + set { int oldValue = _Id; SetId(oldValue, ref value); _Id = value; OnPropertyChanged(); } + } + + // Persistent navigation properties + + /// + /// // Required + /// + public virtual Testing.BParentRequired BParentRequired { get; set; } // Required + /// + /// // Required + /// + public virtual Testing.BParentRequired BParentRequired_1 { get; set; } // Required + /// + /// // Required + /// + public virtual Testing.BParentRequired BParentRequired_2 { get; set; } // Required + public virtual ICollection BParentCollection { get; set; } + public virtual ICollection BParentCollection_2 { get; set; } + public virtual Testing.BParentOptional BParentOptional { get; set; } + public virtual Testing.BParentOptional BParentOptional_1 { get; set; } + public virtual Testing.BParentOptional BParentOptional_2 { get; set; } + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + } +} + diff --git a/src/Testing/Testing_CoreV2/Generated/Entities/BParentCollection.generated.cs b/src/Testing/Testing_CoreV2/Generated/Entities/BParentCollection.generated.cs new file mode 100644 index 000000000..427a845f7 --- /dev/null +++ b/src/Testing/Testing_CoreV2/Generated/Entities/BParentCollection.generated.cs @@ -0,0 +1,87 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Testing +{ + public partial class BParentCollection : INotifyPropertyChanged + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected BParentCollection() + { + Init(); + } + + /// + /// Public constructor with required data + /// + /// + public BParentCollection(Testing.BChild _bchildrequired) + { + if (_bchildrequired == null) throw new ArgumentNullException(nameof(_bchildrequired)); + BChildRequired = _bchildrequired; + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + public static BParentCollection Create(Testing.BChild _bchildrequired) + { + return new BParentCollection(_bchildrequired); + } + + // Persistent properties + + [Key] + [Required] + protected int _Id; + partial void SetId(int oldValue, ref int newValue); + partial void GetId(ref int result); + + /// + /// Identity, Required, Indexed + /// + public int Id + { + get { int value = _Id; GetId(ref value); return (_Id = value); } + set { int oldValue = _Id; SetId(oldValue, ref value); _Id = value; OnPropertyChanged(); } + } + + // Persistent navigation properties + + /// + /// // Required + /// + public virtual Testing.BChild BChildRequired { get; set; } // Required + public virtual Testing.BChild BChildOptional { get; set; } + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + } +} + diff --git a/src/Testing/Testing_CoreV2/Generated/Entities/BParentOptional.generated.cs b/src/Testing/Testing_CoreV2/Generated/Entities/BParentOptional.generated.cs new file mode 100644 index 000000000..ab7069ebf --- /dev/null +++ b/src/Testing/Testing_CoreV2/Generated/Entities/BParentOptional.generated.cs @@ -0,0 +1,91 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Testing +{ + public partial class BParentOptional : INotifyPropertyChanged + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected BParentOptional() + { + BChildCollection = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Public constructor with required data + /// + /// + public BParentOptional(Testing.BChild _bchildrequired) + { + if (_bchildrequired == null) throw new ArgumentNullException(nameof(_bchildrequired)); + BChildRequired = _bchildrequired; + + BChildCollection = new HashSet(); + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + public static BParentOptional Create(Testing.BChild _bchildrequired) + { + return new BParentOptional(_bchildrequired); + } + + // Persistent properties + + [Key] + [Required] + protected int _Id; + partial void SetId(int oldValue, ref int newValue); + partial void GetId(ref int result); + + /// + /// Identity, Required, Indexed + /// + public int Id + { + get { int value = _Id; GetId(ref value); return (_Id = value); } + set { int oldValue = _Id; SetId(oldValue, ref value); _Id = value; OnPropertyChanged(); } + } + + // Persistent navigation properties + + /// + /// // Required + /// + public virtual Testing.BChild BChildRequired { get; set; } // Required + public virtual ICollection BChildCollection { get; set; } + public virtual Testing.BChild BChildOptional { get; set; } + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + } +} + diff --git a/src/Testing/Testing_CoreV2/Generated/Entities/BParentRequired.generated.cs b/src/Testing/Testing_CoreV2/Generated/Entities/BParentRequired.generated.cs new file mode 100644 index 000000000..990c49121 --- /dev/null +++ b/src/Testing/Testing_CoreV2/Generated/Entities/BParentRequired.generated.cs @@ -0,0 +1,91 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Testing +{ + public partial class BParentRequired : INotifyPropertyChanged + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected BParentRequired() + { + BChildCollection = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Public constructor with required data + /// + /// + public BParentRequired(Testing.BChild _bchildrequired) + { + if (_bchildrequired == null) throw new ArgumentNullException(nameof(_bchildrequired)); + BChildRequired = _bchildrequired; + + BChildCollection = new HashSet(); + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + public static BParentRequired Create(Testing.BChild _bchildrequired) + { + return new BParentRequired(_bchildrequired); + } + + // Persistent properties + + [Key] + [Required] + protected int _Id; + partial void SetId(int oldValue, ref int newValue); + partial void GetId(ref int result); + + /// + /// Identity, Required, Indexed + /// + public int Id + { + get { int value = _Id; GetId(ref value); return (_Id = value); } + set { int oldValue = _Id; SetId(oldValue, ref value); _Id = value; OnPropertyChanged(); } + } + + // Persistent navigation properties + + public virtual Testing.BChild BChildOptional { get; set; } + /// + /// // Required + /// + public virtual Testing.BChild BChildRequired { get; set; } // Required + public virtual ICollection BChildCollection { get; set; } + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + } +} + diff --git a/src/Testing/Testing_CoreV2/Generated/Entities/BaseClass.generated.cs b/src/Testing/Testing_CoreV2/Generated/Entities/BaseClass.generated.cs new file mode 100644 index 000000000..9e3469417 --- /dev/null +++ b/src/Testing/Testing_CoreV2/Generated/Entities/BaseClass.generated.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Testing +{ + public partial class BaseClass : Testing.BaseClassWithRequiredProperties, INotifyPropertyChanged + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected BaseClass(): base() + { + Init(); + } + + /// + /// Public constructor with required data + /// + /// + public BaseClass(string _property0) + { + if (string.IsNullOrEmpty(_property0)) throw new ArgumentNullException(nameof(_property0)); + Property0 = _property0; + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + public static new BaseClass Create(string _property0) + { + return new BaseClass(_property0); + } + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + } +} + diff --git a/src/Testing/Testing_CoreV2/Generated/Entities/BaseClassWithRequiredProperties.generated.cs b/src/Testing/Testing_CoreV2/Generated/Entities/BaseClassWithRequiredProperties.generated.cs new file mode 100644 index 000000000..590096b2d --- /dev/null +++ b/src/Testing/Testing_CoreV2/Generated/Entities/BaseClassWithRequiredProperties.generated.cs @@ -0,0 +1,93 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Testing +{ + public partial class BaseClassWithRequiredProperties : INotifyPropertyChanged + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected BaseClassWithRequiredProperties() + { + Init(); + } + + /// + /// Public constructor with required data + /// + /// + public BaseClassWithRequiredProperties(string _property0) + { + if (string.IsNullOrEmpty(_property0)) throw new ArgumentNullException(nameof(_property0)); + Property0 = _property0; + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + public static BaseClassWithRequiredProperties Create(string _property0) + { + return new BaseClassWithRequiredProperties(_property0); + } + + // Persistent properties + + [Key] + [Required] + protected int _Id; + partial void SetId(int oldValue, ref int newValue); + partial void GetId(ref int result); + + /// + /// Identity, Required, Indexed + /// + public int Id + { + get { int value = _Id; GetId(ref value); return (_Id = value); } + set { int oldValue = _Id; SetId(oldValue, ref value); _Id = value; OnPropertyChanged(); } + } + + [Required] + protected string _Property0; + partial void SetProperty0(string oldValue, ref string newValue); + partial void GetProperty0(ref string result); + + /// + /// Required + /// + public string Property0 + { + get { string value = _Property0; GetProperty0(ref value); return (_Property0 = value); } + set { string oldValue = _Property0; SetProperty0(oldValue, ref value); _Property0 = value; OnPropertyChanged(); } + } + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + } +} + diff --git a/src/Testing/Testing_CoreV2/Generated/Entities/Child.generated.cs b/src/Testing/Testing_CoreV2/Generated/Entities/Child.generated.cs new file mode 100644 index 000000000..388e5271a --- /dev/null +++ b/src/Testing/Testing_CoreV2/Generated/Entities/Child.generated.cs @@ -0,0 +1,95 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Testing +{ + public partial class Child : INotifyPropertyChanged + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected Child() + { + Children = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Public constructor with required data + /// + /// + /// + public Child(Testing.Child _parent, Testing.Master _master0) + { + if (_parent == null) throw new ArgumentNullException(nameof(_parent)); + Parent = _parent; + + if (_master0 == null) throw new ArgumentNullException(nameof(_master0)); + _master0.Children.Add(this); + + Children = new HashSet(); + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + /// + public static Child Create(Testing.Child _parent, Testing.Master _master0) + { + return new Child(_parent, _master0); + } + + // Persistent properties + + [Key] + [Required] + protected int _Id; + partial void SetId(int oldValue, ref int newValue); + partial void GetId(ref int result); + + /// + /// Identity, Required, Indexed + /// + public int Id + { + get { int value = _Id; GetId(ref value); return (_Id = value); } + set { int oldValue = _Id; SetId(oldValue, ref value); _Id = value; OnPropertyChanged(); } + } + + // Persistent navigation properties + + public virtual ICollection Children { get; set; } + /// + /// // Required + /// + public virtual Testing.Child Parent { get; set; } // Required + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + } +} + diff --git a/src/Testing/Testing_CoreV2/Generated/Entities/ConcreteDerivedClass.generated.cs b/src/Testing/Testing_CoreV2/Generated/Entities/ConcreteDerivedClass.generated.cs new file mode 100644 index 000000000..28912215c --- /dev/null +++ b/src/Testing/Testing_CoreV2/Generated/Entities/ConcreteDerivedClass.generated.cs @@ -0,0 +1,84 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Testing +{ + public partial class ConcreteDerivedClass : Testing.AbstractBaseClass, INotifyPropertyChanged + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected ConcreteDerivedClass(): base() + { + Init(); + } + + /// + /// Public constructor with required data + /// + /// + public ConcreteDerivedClass(string _property0) + { + if (string.IsNullOrEmpty(_property0)) throw new ArgumentNullException(nameof(_property0)); + Property0 = _property0; + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + public static new ConcreteDerivedClass Create(string _property0) + { + return new ConcreteDerivedClass(_property0); + } + + // Persistent properties + + protected string _Property1; + partial void SetProperty1(string oldValue, ref string newValue); + partial void GetProperty1(ref string result); + + public string Property1 + { + get { string value = _Property1; GetProperty1(ref value); return (_Property1 = value); } + set { string oldValue = _Property1; SetProperty1(oldValue, ref value); _Property1 = value; OnPropertyChanged(); } + } + + protected string _PropertyInChild; + partial void SetPropertyInChild(string oldValue, ref string newValue); + partial void GetPropertyInChild(ref string result); + + public string PropertyInChild + { + get { string value = _PropertyInChild; GetPropertyInChild(ref value); return (_PropertyInChild = value); } + set { string oldValue = _PropertyInChild; SetPropertyInChild(oldValue, ref value); _PropertyInChild = value; OnPropertyChanged(); } + } + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + } +} + diff --git a/src/Testing/Testing_CoreV2/Generated/Entities/ConcreteDerivedClassWithRequiredProperties.generated.cs b/src/Testing/Testing_CoreV2/Generated/Entities/ConcreteDerivedClassWithRequiredProperties.generated.cs new file mode 100644 index 000000000..4c2332fe8 --- /dev/null +++ b/src/Testing/Testing_CoreV2/Generated/Entities/ConcreteDerivedClassWithRequiredProperties.generated.cs @@ -0,0 +1,82 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Testing +{ + public partial class ConcreteDerivedClassWithRequiredProperties : Testing.AbstractBaseClass, INotifyPropertyChanged + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected ConcreteDerivedClassWithRequiredProperties(): base() + { + Init(); + } + + /// + /// Public constructor with required data + /// + /// + /// + public ConcreteDerivedClassWithRequiredProperties(string _property1, string _property0) + { + if (string.IsNullOrEmpty(_property1)) throw new ArgumentNullException(nameof(_property1)); + Property1 = _property1; + if (string.IsNullOrEmpty(_property0)) throw new ArgumentNullException(nameof(_property0)); + Property0 = _property0; + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + /// + public static ConcreteDerivedClassWithRequiredProperties Create(string _property1, string _property0) + { + return new ConcreteDerivedClassWithRequiredProperties(_property1, _property0); + } + + // Persistent properties + + [Required] + protected string _Property1; + partial void SetProperty1(string oldValue, ref string newValue); + partial void GetProperty1(ref string result); + + /// + /// Required + /// + public string Property1 + { + get { string value = _Property1; GetProperty1(ref value); return (_Property1 = value); } + set { string oldValue = _Property1; SetProperty1(oldValue, ref value); _Property1 = value; OnPropertyChanged(); } + } + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + } +} + diff --git a/src/Testing/Testing_CoreV2/Generated/Entities/DerivedClass.generated.cs b/src/Testing/Testing_CoreV2/Generated/Entities/DerivedClass.generated.cs new file mode 100644 index 000000000..5da351fe3 --- /dev/null +++ b/src/Testing/Testing_CoreV2/Generated/Entities/DerivedClass.generated.cs @@ -0,0 +1,84 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Testing +{ + public partial class DerivedClass : Testing.BaseClass, INotifyPropertyChanged + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected DerivedClass(): base() + { + Init(); + } + + /// + /// Public constructor with required data + /// + /// + public DerivedClass(string _property0) + { + if (string.IsNullOrEmpty(_property0)) throw new ArgumentNullException(nameof(_property0)); + Property0 = _property0; + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + public static new DerivedClass Create(string _property0) + { + return new DerivedClass(_property0); + } + + // Persistent properties + + protected string _Property1; + partial void SetProperty1(string oldValue, ref string newValue); + partial void GetProperty1(ref string result); + + public string Property1 + { + get { string value = _Property1; GetProperty1(ref value); return (_Property1 = value); } + set { string oldValue = _Property1; SetProperty1(oldValue, ref value); _Property1 = value; OnPropertyChanged(); } + } + + protected string _PropertyInChild; + partial void SetPropertyInChild(string oldValue, ref string newValue); + partial void GetPropertyInChild(ref string result); + + public string PropertyInChild + { + get { string value = _PropertyInChild; GetPropertyInChild(ref value); return (_PropertyInChild = value); } + set { string oldValue = _PropertyInChild; SetPropertyInChild(oldValue, ref value); _PropertyInChild = value; OnPropertyChanged(); } + } + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + } +} + diff --git a/src/Testing/Testing_CoreV2/Generated/Entities/HiddenEntity.generated.cs b/src/Testing/Testing_CoreV2/Generated/Entities/HiddenEntity.generated.cs new file mode 100644 index 000000000..15ffbbcc7 --- /dev/null +++ b/src/Testing/Testing_CoreV2/Generated/Entities/HiddenEntity.generated.cs @@ -0,0 +1,59 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Testing +{ + public abstract partial class HiddenEntity : INotifyPropertyChanged + { + partial void Init(); + + /// + /// Default constructor. Protected due to being abstract. + /// + protected HiddenEntity() + { + Init(); + } + + // Persistent properties + + [Key] + [Required] + protected int _Id; + partial void SetId(int oldValue, ref int newValue); + partial void GetId(ref int result); + + /// + /// Identity, Required, Indexed + /// + public int Id + { + get { int value = _Id; GetId(ref value); return (_Id = value); } + set { int oldValue = _Id; SetId(oldValue, ref value); _Id = value; OnPropertyChanged(); } + } + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + } +} + diff --git a/src/Testing/Testing_CoreV2/Generated/Entities/Master.generated.cs b/src/Testing/Testing_CoreV2/Generated/Entities/Master.generated.cs new file mode 100644 index 000000000..1895cd435 --- /dev/null +++ b/src/Testing/Testing_CoreV2/Generated/Entities/Master.generated.cs @@ -0,0 +1,64 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Testing +{ + public partial class Master : INotifyPropertyChanged + { + partial void Init(); + + /// + /// Default constructor + /// + public Master() + { + Children = new System.Collections.Generic.HashSet(); + + Init(); + } + + // Persistent properties + + [Key] + [Required] + protected int _Id; + partial void SetId(int oldValue, ref int newValue); + partial void GetId(ref int result); + + /// + /// Identity, Required, Indexed + /// + public int Id + { + get { int value = _Id; GetId(ref value); return (_Id = value); } + set { int oldValue = _Id; SetId(oldValue, ref value); _Id = value; OnPropertyChanged(); } + } + + // Persistent navigation properties + + public virtual ICollection Children { get; set; } + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + } +} + diff --git a/src/Testing/Testing_CoreV2/Generated/Entities/ParserTest.generated.cs b/src/Testing/Testing_CoreV2/Generated/Entities/ParserTest.generated.cs new file mode 100644 index 000000000..a30e09606 --- /dev/null +++ b/src/Testing/Testing_CoreV2/Generated/Entities/ParserTest.generated.cs @@ -0,0 +1,271 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Testing +{ + public partial class ParserTest : INotifyPropertyChanged + { + partial void Init(); + + /// + /// Default constructor + /// + public ParserTest() + { + Init(); + } + + // Persistent properties + + [Key] + [Required] + protected int _Id; + partial void SetId(int oldValue, ref int newValue); + partial void GetId(ref int result); + + /// + /// Identity, Required, Indexed + /// + public int Id + { + get { int value = _Id; GetId(ref value); return (_Id = value); } + set { int oldValue = _Id; SetId(oldValue, ref value); _Id = value; OnPropertyChanged(); } + } + + protected string _name1; + partial void Setname1(string oldValue, ref string newValue); + partial void Getname1(ref string result); + + public string name1 + { + get { string value = _name1; Getname1(ref value); return (_name1 = value); } + set { string oldValue = _name1; Setname1(oldValue, ref value); _name1 = value; OnPropertyChanged(); } + } + + protected string _name2; + partial void Setname2(string oldValue, ref string newValue); + partial void Getname2(ref string result); + + public string name2 + { + get { string value = _name2; Getname2(ref value); return (_name2 = value); } + protected set { string oldValue = _name2; Setname2(oldValue, ref value); _name2 = value; OnPropertyChanged(); } + } + + protected int? _name3; + partial void Setname3(int? oldValue, ref int? newValue); + partial void Getname3(ref int? result); + + public int? name3 + { + get { int? value = _name3; Getname3(ref value); return (_name3 = value); } + set { int? oldValue = _name3; Setname3(oldValue, ref value); _name3 = value; OnPropertyChanged(); } + } + + protected int? _name4; + partial void Setname4(int? oldValue, ref int? newValue); + partial void Getname4(ref int? result); + + public int? name4 + { + get { int? value = _name4; Getname4(ref value); return (_name4 = value); } + protected set { int? oldValue = _name4; Setname4(oldValue, ref value); _name4 = value; OnPropertyChanged(); } + } + + protected int? _name5; + partial void Setname5(int? oldValue, ref int? newValue); + partial void Getname5(ref int? result); + + public int? name5 + { + get { int? value = _name5; Getname5(ref value); return (_name5 = value); } + set { int? oldValue = _name5; Setname5(oldValue, ref value); _name5 = value; OnPropertyChanged(); } + } + + protected int? _name6; + partial void Setname6(int? oldValue, ref int? newValue); + partial void Getname6(ref int? result); + + public int? name6 + { + get { int? value = _name6; Getname6(ref value); return (_name6 = value); } + protected set { int? oldValue = _name6; Setname6(oldValue, ref value); _name6 = value; OnPropertyChanged(); } + } + + [MaxLength(6)] + protected string _name7; + partial void Setname7(string oldValue, ref string newValue); + partial void Getname7(ref string result); + + /// + /// Max length = 6 + /// + public string name7 + { + get { string value = _name7; Getname7(ref value); return (_name7 = value); } + set { string oldValue = _name7; Setname7(oldValue, ref value); _name7 = value; OnPropertyChanged(); } + } + + [MaxLength(6)] + protected string _name8; + partial void Setname8(string oldValue, ref string newValue); + partial void Getname8(ref string result); + + /// + /// Max length = 6 + /// + public string name8 + { + get { string value = _name8; Getname8(ref value); return (_name8 = value); } + protected set { string oldValue = _name8; Setname8(oldValue, ref value); _name8 = value; OnPropertyChanged(); } + } + + [MaxLength(6)] + protected string _name9; + partial void Setname9(string oldValue, ref string newValue); + partial void Getname9(ref string result); + + /// + /// Max length = 6 + /// + public string name9 + { + get { string value = _name9; Getname9(ref value); return (_name9 = value); } + set { string oldValue = _name9; Setname9(oldValue, ref value); _name9 = value; OnPropertyChanged(); } + } + + [MaxLength(6)] + protected string _name; + partial void Setname(string oldValue, ref string newValue); + partial void Getname(ref string result); + + /// + /// Max length = 6 + /// + public string name + { + get { string value = _name; Getname(ref value); return (_name = value); } + protected set { string oldValue = _name; Setname(oldValue, ref value); _name = value; OnPropertyChanged(); } + } + + protected int? _name11; + partial void Setname11(int? oldValue, ref int? newValue); + partial void Getname11(ref int? result); + + public int? name11 + { + get { int? value = _name11; Getname11(ref value); return (_name11 = value); } + set { int? oldValue = _name11; Setname11(oldValue, ref value); _name11 = value; OnPropertyChanged(); } + } + + protected int? _name12; + partial void Setname12(int? oldValue, ref int? newValue); + partial void Getname12(ref int? result); + + public int? name12 + { + get { int? value = _name12; Getname12(ref value); return (_name12 = value); } + protected set { int? oldValue = _name12; Setname12(oldValue, ref value); _name12 = value; OnPropertyChanged(); } + } + + protected int? _name13; + partial void Setname13(int? oldValue, ref int? newValue); + partial void Getname13(ref int? result); + + public int? name13 + { + get { int? value = _name13; Getname13(ref value); return (_name13 = value); } + set { int? oldValue = _name13; Setname13(oldValue, ref value); _name13 = value; OnPropertyChanged(); } + } + + protected int? _name14; + partial void Setname14(int? oldValue, ref int? newValue); + partial void Getname14(ref int? result); + + public int? name14 + { + get { int? value = _name14; Getname14(ref value); return (_name14 = value); } + protected set { int? oldValue = _name14; Setname14(oldValue, ref value); _name14 = value; OnPropertyChanged(); } + } + + [MaxLength(6)] + protected string _name15; + partial void Setname15(string oldValue, ref string newValue); + partial void Getname15(ref string result); + + /// + /// Max length = 6 + /// + public string name15 + { + get { string value = _name15; Getname15(ref value); return (_name15 = value); } + set { string oldValue = _name15; Setname15(oldValue, ref value); _name15 = value; OnPropertyChanged(); } + } + + [MaxLength(6)] + protected string _name16; + partial void Setname16(string oldValue, ref string newValue); + partial void Getname16(ref string result); + + /// + /// Max length = 6 + /// + public string name16 + { + get { string value = _name16; Getname16(ref value); return (_name16 = value); } + protected set { string oldValue = _name16; Setname16(oldValue, ref value); _name16 = value; OnPropertyChanged(); } + } + + [MaxLength(6)] + protected string _name17; + partial void Setname17(string oldValue, ref string newValue); + partial void Getname17(ref string result); + + /// + /// Max length = 6 + /// + public string name17 + { + get { string value = _name17; Getname17(ref value); return (_name17 = value); } + set { string oldValue = _name17; Setname17(oldValue, ref value); _name17 = value; OnPropertyChanged(); } + } + + [MaxLength(6)] + protected string _name18; + partial void Setname18(string oldValue, ref string newValue); + partial void Getname18(ref string result); + + /// + /// Max length = 6 + /// + public string name18 + { + get { string value = _name18; Getname18(ref value); return (_name18 = value); } + protected set { string oldValue = _name18; Setname18(oldValue, ref value); _name18 = value; OnPropertyChanged(); } + } + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + } +} + diff --git a/src/Testing/Testing_CoreV2/Generated/Entities/RenamedColumn.generated.cs b/src/Testing/Testing_CoreV2/Generated/Entities/RenamedColumn.generated.cs new file mode 100644 index 000000000..fd7bdc9bc --- /dev/null +++ b/src/Testing/Testing_CoreV2/Generated/Entities/RenamedColumn.generated.cs @@ -0,0 +1,59 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Testing +{ + public partial class RenamedColumn : INotifyPropertyChanged + { + partial void Init(); + + /// + /// Default constructor + /// + public RenamedColumn() + { + Init(); + } + + // Persistent properties + + [Key] + [Required] + protected int _Id; + partial void SetId(int oldValue, ref int newValue); + partial void GetId(ref int result); + + /// + /// Identity, Required, Indexed + /// + public int Id + { + get { int value = _Id; GetId(ref value); return (_Id = value); } + set { int oldValue = _Id; SetId(oldValue, ref value); _Id = value; OnPropertyChanged(); } + } + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + } +} + diff --git a/src/Testing/Testing_CoreV2/Generated/Entities/UChild.generated.cs b/src/Testing/Testing_CoreV2/Generated/Entities/UChild.generated.cs new file mode 100644 index 000000000..b933dbea6 --- /dev/null +++ b/src/Testing/Testing_CoreV2/Generated/Entities/UChild.generated.cs @@ -0,0 +1,92 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Testing +{ + public partial class UChild : INotifyPropertyChanged + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected UChild() + { + Init(); + } + + /// + /// Public constructor with required data + /// + /// + /// + /// + public UChild(Testing.UParentRequired _uparentrequired0, Testing.UParentRequired _uparentrequired1, Testing.UParentRequired _uparentrequired2) + { + if (_uparentrequired0 == null) throw new ArgumentNullException(nameof(_uparentrequired0)); + _uparentrequired0.UChildRequired = this; + + if (_uparentrequired1 == null) throw new ArgumentNullException(nameof(_uparentrequired1)); + _uparentrequired1.UChildCollection.Add(this); + + if (_uparentrequired2 == null) throw new ArgumentNullException(nameof(_uparentrequired2)); + _uparentrequired2.UChildOptional = this; + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + /// + /// + public static UChild Create(Testing.UParentRequired _uparentrequired0, Testing.UParentRequired _uparentrequired1, Testing.UParentRequired _uparentrequired2) + { + return new UChild(_uparentrequired0, _uparentrequired1, _uparentrequired2); + } + + // Persistent properties + + [Key] + [Required] + protected int _Id; + partial void SetId(int oldValue, ref int newValue); + partial void GetId(ref int result); + + /// + /// Identity, Required, Indexed + /// + public int Id + { + get { int value = _Id; GetId(ref value); return (_Id = value); } + set { int oldValue = _Id; SetId(oldValue, ref value); _Id = value; OnPropertyChanged(); } + } + + // Persistent navigation properties + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + } +} + diff --git a/src/Testing/Testing_CoreV2/Generated/Entities/UParentCollection.generated.cs b/src/Testing/Testing_CoreV2/Generated/Entities/UParentCollection.generated.cs new file mode 100644 index 000000000..8fa3f90c0 --- /dev/null +++ b/src/Testing/Testing_CoreV2/Generated/Entities/UParentCollection.generated.cs @@ -0,0 +1,87 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Testing +{ + public partial class UParentCollection : INotifyPropertyChanged + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected UParentCollection() + { + Init(); + } + + /// + /// Public constructor with required data + /// + /// + public UParentCollection(Testing.UChild _uchildrequired) + { + if (_uchildrequired == null) throw new ArgumentNullException(nameof(_uchildrequired)); + UChildRequired = _uchildrequired; + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + public static UParentCollection Create(Testing.UChild _uchildrequired) + { + return new UParentCollection(_uchildrequired); + } + + // Persistent properties + + [Key] + [Required] + protected int _Id; + partial void SetId(int oldValue, ref int newValue); + partial void GetId(ref int result); + + /// + /// Identity, Required, Indexed + /// + public int Id + { + get { int value = _Id; GetId(ref value); return (_Id = value); } + set { int oldValue = _Id; SetId(oldValue, ref value); _Id = value; OnPropertyChanged(); } + } + + // Persistent navigation properties + + /// + /// // Required + /// + public virtual Testing.UChild UChildRequired { get; set; } // Required + public virtual Testing.UChild UChildOptional { get; set; } + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + } +} + diff --git a/src/Testing/Testing_CoreV2/Generated/Entities/UParentOptional.generated.cs b/src/Testing/Testing_CoreV2/Generated/Entities/UParentOptional.generated.cs new file mode 100644 index 000000000..709686f31 --- /dev/null +++ b/src/Testing/Testing_CoreV2/Generated/Entities/UParentOptional.generated.cs @@ -0,0 +1,90 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Testing +{ + public partial class UParentOptional : Testing.HiddenEntity, INotifyPropertyChanged + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected UParentOptional(): base() + { + PropertyInChild = "hello"; + UChildCollection = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Public constructor with required data + /// + /// + public UParentOptional(Testing.UChild _uchildrequired) + { + if (_uchildrequired == null) throw new ArgumentNullException(nameof(_uchildrequired)); + UChildRequired = _uchildrequired; + + UChildCollection = new HashSet(); + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + public static UParentOptional Create(Testing.UChild _uchildrequired) + { + return new UParentOptional(_uchildrequired); + } + + // Persistent properties + + protected string _PropertyInChild; + partial void SetPropertyInChild(string oldValue, ref string newValue); + partial void GetPropertyInChild(ref string result); + + /// + /// Default value = "hello" + /// + public string PropertyInChild + { + get { string value = _PropertyInChild; GetPropertyInChild(ref value); return (_PropertyInChild = value); } + set { string oldValue = _PropertyInChild; SetPropertyInChild(oldValue, ref value); _PropertyInChild = value; OnPropertyChanged(); } + } + + // Persistent navigation properties + + public virtual Testing.UChild UChildOptional { get; set; } + public virtual ICollection UChildCollection { get; set; } + /// + /// // Required + /// + public virtual Testing.UChild UChildRequired { get; set; } // Required + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + } +} + diff --git a/src/Testing/Testing_CoreV2/Generated/Entities/UParentRequired.generated.cs b/src/Testing/Testing_CoreV2/Generated/Entities/UParentRequired.generated.cs new file mode 100644 index 000000000..5c7a23c16 --- /dev/null +++ b/src/Testing/Testing_CoreV2/Generated/Entities/UParentRequired.generated.cs @@ -0,0 +1,91 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Testing +{ + public partial class UParentRequired : INotifyPropertyChanged + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected UParentRequired() + { + UChildCollection = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Public constructor with required data + /// + /// + public UParentRequired(Testing.UChild _uchildrequired) + { + if (_uchildrequired == null) throw new ArgumentNullException(nameof(_uchildrequired)); + UChildRequired = _uchildrequired; + + UChildCollection = new HashSet(); + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + public static UParentRequired Create(Testing.UChild _uchildrequired) + { + return new UParentRequired(_uchildrequired); + } + + // Persistent properties + + [Key] + [Required] + protected int _Id; + partial void SetId(int oldValue, ref int newValue); + partial void GetId(ref int result); + + /// + /// Identity, Required, Indexed + /// + public int Id + { + get { int value = _Id; GetId(ref value); return (_Id = value); } + set { int oldValue = _Id; SetId(oldValue, ref value); _Id = value; OnPropertyChanged(); } + } + + // Persistent navigation properties + + /// + /// // Required + /// + public virtual Testing.UChild UChildRequired { get; set; } // Required + public virtual ICollection UChildCollection { get; set; } + public virtual Testing.UChild UChildOptional { get; set; } + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + } +} + diff --git a/src/Testing/Testing_CoreV2/Generated/Enums/Enum1.generated.cs b/src/Testing/Testing_CoreV2/Generated/Enums/Enum1.generated.cs new file mode 100644 index 000000000..f2dc29b2f --- /dev/null +++ b/src/Testing/Testing_CoreV2/Generated/Enums/Enum1.generated.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; + +namespace Testing +{ + public enum Enum1 : Int32 + { + D = 1, + B = 3, + C + } +}