diff --git a/changelog.txt b/changelog.txt
index f75377f1c..b5b952388 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -1,5 +1,8 @@
3.0.4
- Added context menu choice to visually align node elements on diagrams.
+ - Fix to detecting correct EF version with anything with "Latest" in it is configured (see https://github.com/msawczyn/EFDesigner/issues/266)
+ - Fix to generate correct initial value code for decimal properties (see https://github.com/msawczyn/EFDesigner/issues/268)
+ - Fix for constructor code generation in 1-N unidirectional associations (see https://github.com/msawczyn/EFDesigner/issues/263)
3.0.3
- Added VS UML icon for model file in solution explorer (thanks to https://github.com/dcastenholz for the change)
diff --git a/dist/Sawczyn.EFDesigner.EFModel.DslPackage.vsix b/dist/Sawczyn.EFDesigner.EFModel.DslPackage.vsix
index 40ed26696..27e1b0ce4 100644
Binary files a/dist/Sawczyn.EFDesigner.EFModel.DslPackage.vsix and b/dist/Sawczyn.EFDesigner.EFModel.DslPackage.vsix differ
diff --git a/src/Dsl/CustomCode/Partials/Association.cs b/src/Dsl/CustomCode/Partials/Association.cs
index 7455b3480..40715b4ed 100644
--- a/src/Dsl/CustomCode/Partials/Association.cs
+++ b/src/Dsl/CustomCode/Partials/Association.cs
@@ -243,8 +243,8 @@ internal bool AllCardinalitiesAreValid(out string errorMessage)
}
[ValidationMethod(ValidationCategories.Save | ValidationCategories.Menu)]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validatioin")]
- // ReSharper disable once UnusedMember.Local
+ [UsedImplicitly]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validation")]
private void ValidateMultiplicity(ValidationContext context)
{
if (!AllCardinalitiesAreValid(out string errorMessage))
@@ -252,8 +252,8 @@ private void ValidateMultiplicity(ValidationContext context)
}
[ValidationMethod(ValidationCategories.Open | ValidationCategories.Save | ValidationCategories.Menu)]
- // ReSharper disable once UnusedMember.Local
- [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validatioin")]
+ [UsedImplicitly]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validation")]
private void SummaryDescriptionIsEmpty(ValidationContext context)
{
if (Source?.ModelRoot == null) return;
@@ -268,8 +268,8 @@ private void SummaryDescriptionIsEmpty(ValidationContext context)
}
[ValidationMethod(ValidationCategories.Open | ValidationCategories.Save | ValidationCategories.Menu)]
- // ReSharper disable once UnusedMember.Local
- [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validatioin")]
+ [UsedImplicitly]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validation")]
private void TPCEndpointsOnlyOnLeafNodes(ValidationContext context)
{
if (Source?.ModelRoot == null) return;
@@ -282,7 +282,7 @@ private void TPCEndpointsOnlyOnLeafNodes(ValidationContext context)
[ValidationMethod(ValidationCategories.Save | ValidationCategories.Load | ValidationCategories.Menu)]
[UsedImplicitly]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validatioin")]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validation")]
private void MustDetermineEndpointRoles(ValidationContext context)
{
if (Source?.ModelRoot == null)
@@ -298,7 +298,7 @@ private void MustDetermineEndpointRoles(ValidationContext context)
[ValidationMethod(ValidationCategories.Save | ValidationCategories.Load | ValidationCategories.Menu)]
[UsedImplicitly]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validatioin")]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validation")]
private void FKPropertiesCannotBeStoreGeneratedIdentifiers(ValidationContext context)
{
@@ -338,6 +338,7 @@ string GetShadowPropertyName(string nameBase)
if (SourceRole == EndpointRole.Dependent)
return $"{nameBase}{identityAttribute.Name}";
+ // ReSharper disable once ConvertIfStatementToReturnStatement
if (this is BidirectionalAssociation)
return $"{nameBase}{identityAttribute.Name}";
@@ -362,7 +363,8 @@ string GetShadowPropertyNameBase()
}
[ValidationMethod(ValidationCategories.Save | ValidationCategories.Load | ValidationCategories.Menu)]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validatioin")]
+ [UsedImplicitly]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validation")]
private void FKPropertiesInvalidWithoutDependentEnd(ValidationContext context)
{
if (string.IsNullOrWhiteSpace(FKPropertyName))
@@ -377,7 +379,8 @@ private void FKPropertiesInvalidWithoutDependentEnd(ValidationContext context)
}
[ValidationMethod(ValidationCategories.Save | ValidationCategories.Load | ValidationCategories.Menu)]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validatioin")]
+ [UsedImplicitly]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validation")]
private void FKPropertiesMatchIdentityProperties(ValidationContext context)
{
if (string.IsNullOrWhiteSpace(FKPropertyName) || Principal == null)
diff --git a/src/Dsl/CustomCode/Partials/BidirectionalAssociation.cs b/src/Dsl/CustomCode/Partials/BidirectionalAssociation.cs
index d5211c0ce..ab76c97b5 100644
--- a/src/Dsl/CustomCode/Partials/BidirectionalAssociation.cs
+++ b/src/Dsl/CustomCode/Partials/BidirectionalAssociation.cs
@@ -4,6 +4,7 @@
using Microsoft.VisualStudio.Modeling;
using Microsoft.VisualStudio.Modeling.Validation;
+using Sawczyn.EFDesigner.EFModel.Annotations;
using Sawczyn.EFDesigner.EFModel.Extensions;
namespace Sawczyn.EFDesigner.EFModel
@@ -19,8 +20,8 @@ private string GetSourcePropertyNameDisplayValue()
}
[ValidationMethod(ValidationCategories.Open | ValidationCategories.Save | ValidationCategories.Menu)]
- // ReSharper disable once UnusedMember.Local
- [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validatioin")]
+ [UsedImplicitly]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validation")]
private void SummaryDescriptionIsEmpty(ValidationContext context)
{
if (Source?.ModelRoot == null) return;
diff --git a/src/Dsl/CustomCode/Partials/ModelAttribute.cs b/src/Dsl/CustomCode/Partials/ModelAttribute.cs
index e0d7cc167..e95ed862e 100644
--- a/src/Dsl/CustomCode/Partials/ModelAttribute.cs
+++ b/src/Dsl/CustomCode/Partials/ModelAttribute.cs
@@ -1,5 +1,4 @@
using System;
-using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Linq;
using Microsoft.VisualStudio.Modeling;
@@ -13,7 +12,7 @@
namespace Sawczyn.EFDesigner.EFModel
{
[ValidationState(ValidationState.Enabled)]
- [SuppressMessage("ReSharper", "ArrangeAccessorOwnerBody")]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "ArrangeAccessorOwnerBody")]
public partial class ModelAttribute : IModelElementInCompartment, IDisplaysWarning, IHasStore
{
internal const int MAXLENGTH_MAX = -1;
@@ -116,8 +115,6 @@ public bool SupportsInitialValue
/// Name of type to test. If typeName is null, Type property will be used. If initialValue is null, InitialValue property will be used
/// Initial value to test
/// true if InitialValue is a valid value for the type, or if initialValue is null or empty
-#pragma warning disable 168
- [SuppressMessage("ReSharper", "BuiltInTypeReferenceStyle")]
public bool IsValidInitialValue(string typeName = null, string initialValue = null)
{
typeName = typeName ?? Type;
@@ -154,9 +151,9 @@ public bool IsValidInitialValue(string typeName = null, string initialValue = nu
case "Polygon":
return false; //string.IsNullOrEmpty(initialValue);
case "Boolean":
- return bool.TryParse(initialValue, out bool _bool);
+ return bool.TryParse(initialValue, out _);
case "Byte":
- return byte.TryParse(initialValue, out byte _byte);
+ return byte.TryParse(initialValue, out _);
case "DateTime":
switch (initialValue?.Trim())
{
@@ -166,32 +163,32 @@ public bool IsValidInitialValue(string typeName = null, string initialValue = nu
case "DateTime.MaxValue":
return true;
default:
- return DateTime.TryParse(initialValue, out DateTime _dateTime);
+ return DateTime.TryParse(initialValue, out _);
}
case "DateTimeOffset":
- return DateTimeOffset.TryParse(initialValue, out DateTimeOffset _dateTimeOffset);
+ return DateTimeOffset.TryParse(initialValue, out _);
case "Decimal":
- return Decimal.TryParse(initialValue, out Decimal _decimal);
+ return Decimal.TryParse(initialValue, out _);
case "Double":
- return Double.TryParse(initialValue, out Double _double);
+ return Double.TryParse(initialValue, out _);
case "Guid":
- return Guid.TryParse(initialValue, out Guid _guid);
+ return Guid.TryParse(initialValue, out _);
case "Int16":
- return Int16.TryParse(initialValue, out Int16 _int16);
+ return Int16.TryParse(initialValue, out _);
case "UInt16":
- return UInt16.TryParse(initialValue, out UInt16 _uint16);
+ return UInt16.TryParse(initialValue, out _);
case "Int32":
- return Int32.TryParse(initialValue, out Int32 _int32);
+ return Int32.TryParse(initialValue, out _);
case "UInt32":
- return UInt32.TryParse(initialValue, out UInt32 _uint32);
+ return UInt32.TryParse(initialValue, out _);
case "Int64":
- return Int64.TryParse(initialValue, out Int64 _int64);
+ return Int64.TryParse(initialValue, out _);
case "UInt64":
- return UInt64.TryParse(initialValue, out UInt64 _uint64);
+ return UInt64.TryParse(initialValue, out _);
case "SByte":
- return SByte.TryParse(initialValue, out SByte _sbyte);
+ return SByte.TryParse(initialValue, out _);
case "Single":
- return Single.TryParse(initialValue, out Single _single);
+ return Single.TryParse(initialValue, out _);
case "String":
return true;
case "Time":
@@ -199,8 +196,7 @@ public bool IsValidInitialValue(string typeName = null, string initialValue = nu
new[] { "HH:mm:ss", "H:mm:ss", "HH:mm", "H:mm", "HH:mm:ss tt", "H:mm:ss tt", "HH:mm tt", "H:mm tt" },
CultureInfo.InvariantCulture,
DateTimeStyles.None,
- out DateTime _time);
- // ReSharper restore UnusedVariable
+ out _);
default:
if (initialValue.Contains("."))
{
@@ -214,7 +210,6 @@ public bool IsValidInitialValue(string typeName = null, string initialValue = nu
return false;
}
-#pragma warning restore 168
///
/// From internal class System.Data.Metadata.Edm.PrimitiveType in System.Data.Entity. Converts the attribute's CLR type to a C# primitive type.
@@ -935,6 +930,7 @@ internal static (string ef6Version, string efCoreVersion)[] GeometryTypes = {
[ValidationMethod(ValidationCategories.Open | ValidationCategories.Save | ValidationCategories.Menu)]
[UsedImplicitly]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validation")]
private void GeographyTypeDoesNotMatchEFVersion(ValidationContext context)
{
if (ModelClass?.ModelRoot == null) return;
@@ -966,7 +962,8 @@ private void GeographyTypeDoesNotMatchEFVersion(ValidationContext context)
}
[ValidationMethod(ValidationCategories.Open | ValidationCategories.Save | ValidationCategories.Menu)]
- // ReSharper disable once UnusedMember.Local
+ [UsedImplicitly]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validation")]
private void StringsShouldHaveLength(ValidationContext context)
{
if (ModelClass?.ModelRoot == null) return;
@@ -980,7 +977,8 @@ private void StringsShouldHaveLength(ValidationContext context)
}
[ValidationMethod(ValidationCategories.Open | ValidationCategories.Save | ValidationCategories.Menu)]
- // ReSharper disable once UnusedMember.Local
+ [UsedImplicitly]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validation")]
private void SummaryDescriptionIsEmpty(ValidationContext context)
{
if (ModelClass?.ModelRoot == null) return;
diff --git a/src/Dsl/CustomCode/Partials/ModelClass.cs b/src/Dsl/CustomCode/Partials/ModelClass.cs
index ca7e1528c..7d3214511 100644
--- a/src/Dsl/CustomCode/Partials/ModelClass.cs
+++ b/src/Dsl/CustomCode/Partials/ModelClass.cs
@@ -6,6 +6,7 @@
using Microsoft.VisualStudio.Modeling;
using Microsoft.VisualStudio.Modeling.Validation;
+using Sawczyn.EFDesigner.EFModel.Annotations;
using Sawczyn.EFDesigner.EFModel.Extensions;
// ReSharper disable UnusedMember.Global
@@ -493,6 +494,8 @@ internal void MoveAttribute(ModelAttribute attribute, ModelClass destination)
#region Validations
[ValidationMethod(ValidationCategories.Open | ValidationCategories.Save | ValidationCategories.Menu)]
+ [UsedImplicitly]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validation")]
private void ClassShouldHaveAttributes(ValidationContext context)
{
if (ModelRoot == null) return;
@@ -506,6 +509,8 @@ private void ClassShouldHaveAttributes(ValidationContext context)
}
[ValidationMethod(ValidationCategories.Open | ValidationCategories.Menu)]
+ [UsedImplicitly]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validation")]
private void OwnedTypeCannotHaveABaseClass(ValidationContext context)
{
if (ModelRoot == null) return;
@@ -514,6 +519,8 @@ private void OwnedTypeCannotHaveABaseClass(ValidationContext context)
}
[ValidationMethod(ValidationCategories.Open | ValidationCategories.Menu)]
+ [UsedImplicitly]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validation")]
private void OwnedTypeCannotHaveASubclass(ValidationContext context)
{
if (ModelRoot == null) return;
@@ -522,6 +529,8 @@ private void OwnedTypeCannotHaveASubclass(ValidationContext context)
}
[ValidationMethod(ValidationCategories.Open | ValidationCategories.Menu)]
+ [UsedImplicitly]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validation")]
private void OwnedTypeCannotBeAbstract(ValidationContext context)
{
if (ModelRoot == null) return;
@@ -530,6 +539,8 @@ private void OwnedTypeCannotBeAbstract(ValidationContext context)
}
[ValidationMethod(ValidationCategories.Open | ValidationCategories.Menu)]
+ [UsedImplicitly]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validation")]
private void OwnedTypeCannotBePrincipal(ValidationContext context)
{
if (ModelRoot == null) return;
@@ -544,6 +555,8 @@ private void OwnedTypeCannotBePrincipal(ValidationContext context)
}
[ValidationMethod(ValidationCategories.Open | ValidationCategories.Menu)]
+ [UsedImplicitly]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validation")]
private void OwnedTypeCannotBeInBidirectionalAssociation(ValidationContext context)
{
if (ModelRoot == null) return;
@@ -553,6 +566,8 @@ private void OwnedTypeCannotBeInBidirectionalAssociation(ValidationContext conte
}
[ValidationMethod(ValidationCategories.Open | ValidationCategories.Save | ValidationCategories.Menu)]
+ [UsedImplicitly]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validation")]
private void AttributesCannotBeNamedSameAsEnclosingClass(ValidationContext context)
{
if (ModelRoot == null) return;
@@ -562,6 +577,8 @@ private void AttributesCannotBeNamedSameAsEnclosingClass(ValidationContext conte
}
[ValidationMethod(ValidationCategories.Open | ValidationCategories.Save | ValidationCategories.Menu)]
+ [UsedImplicitly]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validation")]
private void PersistentClassesMustHaveIdentity(ValidationContext context)
{
if (ModelRoot == null) return;
@@ -571,6 +588,8 @@ private void PersistentClassesMustHaveIdentity(ValidationContext context)
}
[ValidationMethod(ValidationCategories.Open | ValidationCategories.Save | ValidationCategories.Menu)]
+ [UsedImplicitly]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validation")]
private void DerivedClassesShouldNotHaveIdentity(ValidationContext context)
{
if (ModelRoot == null) return;
@@ -594,6 +613,8 @@ private void DerivedClassesShouldNotHaveIdentity(ValidationContext context)
}
[ValidationMethod(ValidationCategories.Open | ValidationCategories.Save | ValidationCategories.Menu)]
+ [UsedImplicitly]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validation")]
private void SummaryDescriptionIsEmpty(ValidationContext context)
{
if (ModelRoot == null) return;
diff --git a/src/Dsl/CustomCode/Partials/ModelEnum.cs b/src/Dsl/CustomCode/Partials/ModelEnum.cs
index 166af2db2..53193cfc9 100644
--- a/src/Dsl/CustomCode/Partials/ModelEnum.cs
+++ b/src/Dsl/CustomCode/Partials/ModelEnum.cs
@@ -6,6 +6,7 @@
using System.ComponentModel;
using System.Linq;
+using Sawczyn.EFDesigner.EFModel.Annotations;
using Sawczyn.EFDesigner.EFModel.Extensions;
namespace Sawczyn.EFDesigner.EFModel
@@ -189,7 +190,8 @@ internal virtual void ResetIsTrackingProperties()
}
[ValidationMethod(ValidationCategories.Open | ValidationCategories.Save | ValidationCategories.Menu)]
- // ReSharper disable once UnusedMember.Local
+ [UsedImplicitly]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validation")]
private void EnumMustHaveValues(ValidationContext context)
{
if (ModelRoot == null) return;
@@ -199,7 +201,8 @@ private void EnumMustHaveValues(ValidationContext context)
}
[ValidationMethod(ValidationCategories.Open | ValidationCategories.Save | ValidationCategories.Menu)]
- // ReSharper disable once UnusedMember.Local
+ [UsedImplicitly]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validation")]
private void EnumValueInitializationsShouldBeAllOrNothing(ValidationContext context)
{
if (ModelRoot == null) return;
@@ -213,7 +216,8 @@ private void EnumValueInitializationsShouldBeAllOrNothing(ValidationContext cont
}
[ValidationMethod(ValidationCategories.Open | ValidationCategories.Save | ValidationCategories.Menu)]
- // ReSharper disable once UnusedMember.Local
+ [UsedImplicitly]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validation")]
private void SummaryDescriptionIsEmpty(ValidationContext context)
{
if (ModelRoot == null) return;
diff --git a/src/Dsl/CustomCode/Partials/ModelEnumValue.cs b/src/Dsl/CustomCode/Partials/ModelEnumValue.cs
index 0e718f4eb..0c6373499 100644
--- a/src/Dsl/CustomCode/Partials/ModelEnumValue.cs
+++ b/src/Dsl/CustomCode/Partials/ModelEnumValue.cs
@@ -2,9 +2,10 @@
using Microsoft.VisualStudio.Modeling.Diagrams;
using Microsoft.VisualStudio.Modeling.Validation;
using Sawczyn.EFDesigner.EFModel.Extensions;
-using System.Collections.Generic;
using System.Linq;
+using Sawczyn.EFDesigner.EFModel.Annotations;
+
namespace Sawczyn.EFDesigner.EFModel
{
[ValidationState(ValidationState.Enabled)]
@@ -41,7 +42,8 @@ public void RedrawItem()
#endregion
[ValidationMethod(ValidationCategories.Open | ValidationCategories.Save | ValidationCategories.Menu)]
- // ReSharper disable once UnusedMember.Local
+ [UsedImplicitly]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validation")]
private void SummaryDescriptionIsEmpty(ValidationContext context)
{
if (Enum?.ModelRoot == null) return;
diff --git a/src/Dsl/CustomCode/Partials/ModelRoot.cs b/src/Dsl/CustomCode/Partials/ModelRoot.cs
index 8685fd9aa..a85fa6bf4 100644
--- a/src/Dsl/CustomCode/Partials/ModelRoot.cs
+++ b/src/Dsl/CustomCode/Partials/ModelRoot.cs
@@ -9,6 +9,7 @@
using Microsoft.VisualStudio.Modeling.Diagrams;
using Microsoft.VisualStudio.Modeling.Validation;
+using Sawczyn.EFDesigner.EFModel.Annotations;
using Sawczyn.EFDesigner.EFModel.Extensions;
namespace Sawczyn.EFDesigner.EFModel
@@ -290,40 +291,73 @@ public bool IsValidCLRType(string type)
#region Nuget
+ [Obsolete]
public NuGetDisplay NuGetPackageVersion
{
get
{
return NuGetHelper.NuGetPackageDisplay
- .FirstOrDefault(x => x.EFVersion == EntityFrameworkVersion
+ .FirstOrDefault(x => x.EFVersion == EntityFrameworkVersion
&& x.DisplayVersion == EntityFrameworkPackageVersion);
}
}
+ ///
+ /// Transforms the selected EntityFrameworkPackageVersion into a decimal number, only taking the first two segments into account. If a "Latest" version is chosen, looks up the appropriate real version.
+ ///
public double GetEntityFrameworkPackageVersionNum()
{
string packageVersion = EntityFrameworkPackageVersion;
+ string[] parts = packageVersion.Split('.');
if (packageVersion.EndsWith("Latest"))
- packageVersion = NuGetHelper.EFPackageVersions[EntityFrameworkVersion].Where(x => !x.EndsWith("Latest")).OrderByDescending(x => x).FirstOrDefault();
+ {
+ (int A, int B, int C) actualVersion;
- string[] parts = (packageVersion ?? "").Split('.');
+ switch (parts.Length)
+ {
+ case 1: // just "Latest"
+ actualVersion = NugetVersions.Last();
+ break;
+ case 2: // x.Latest
+ actualVersion = NugetVersions.Last(v => v.A == int.Parse(parts[0]));
+ break;
+ default: // x.y.Latest
+ actualVersion = NugetVersions.Last(v => v.A == int.Parse(parts[0]) && v.B == int.Parse(parts[1]));
+ break;
+ }
- string resultString = parts.Length > 1
- ? $"{parts[0]}.{parts[1]}"
- : parts.FirstOrDefault();
+ packageVersion = $"{actualVersion.A}.{actualVersion.B}";
+ }
+ else
+ packageVersion = $"{parts[0]}.{parts[1]}";
- return double.TryParse(resultString, out double result)
- ? result
- : 0;
+ return double.Parse(packageVersion);
}
+ private List<(int A, int B, int C)> nugetVersions;
+ private List<(int A, int B, int C)> NugetVersions
+ {
+ get
+ {
+ return nugetVersions
+ ?? (nugetVersions = NuGetHelper.EFPackageVersions[EntityFrameworkVersion]
+ .Where(x => x.Count(c => c == '.') == 2)
+ .Select(v => (int.TryParse(v.Substring(0, v.IndexOf('.')), out int x1) ? x1 : 0
+ , int.TryParse(v.Substring(v.IndexOf('.') + 1, v.IndexOf('.', v.IndexOf('.') + 1) - v.IndexOf('.') - 1), out int x2) ? x2 : 0
+ , int.TryParse(v.Substring(v.IndexOf('.', v.IndexOf('.') + 1) + 1), out int x3) ? x3 : 0))
+ .OrderBy<(int A, int B, int C), int>(v => v.A).ThenBy(v => v.B).ThenBy(v => v.C)
+ .Distinct()
+ .ToList());
+ }
+ }
#endregion Nuget
#region Validation methods
[ValidationMethod(ValidationCategories.Open | ValidationCategories.Save | ValidationCategories.Menu)]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validatioin")]
+ [UsedImplicitly]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validation")]
private void ConnectionStringMustExist(ValidationContext context)
{
if (!Classes.Any() && !Enums.Any())
@@ -337,7 +371,8 @@ private void ConnectionStringMustExist(ValidationContext context)
}
[ValidationMethod(ValidationCategories.Open | ValidationCategories.Save | ValidationCategories.Menu)]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validatioin")]
+ [UsedImplicitly]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by validation")]
private void SummaryDescriptionIsEmpty(ValidationContext context)
{
if (string.IsNullOrWhiteSpace(Summary) && WarnOnMissingDocumentation)
diff --git a/src/Dsl/DslDefinition.dsl b/src/Dsl/DslDefinition.dsl
index c75f0b77c..d30e18fd4 100644
--- a/src/Dsl/DslDefinition.dsl
+++ b/src/Dsl/DslDefinition.dsl
@@ -1,5 +1,5 @@
-
+
diff --git a/src/Dsl/GeneratedCode/DomainClasses.cs b/src/Dsl/GeneratedCode/DomainClasses.cs
index a3db16715..d452049de 100644
--- a/src/Dsl/GeneratedCode/DomainClasses.cs
+++ b/src/Dsl/GeneratedCode/DomainClasses.cs
@@ -13432,6 +13432,6 @@ namespace Sawczyn.EFDesigner.EFModel
///
partial class ModelRoot
{
- public const string DSLVersion = "3.0.4.4";
+ public const string DSLVersion = "3.0.4.5";
}
}
diff --git a/src/Dsl/GeneratedCode/SerializationHelper.cs b/src/Dsl/GeneratedCode/SerializationHelper.cs
index 6e78785a7..8b5c99cc6 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("3.0.4.4");
+ rootElementSettings.Version = new global::System.Version("3.0.4.5");
// 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("3.0.4.4");
+ global::System.Version expectedVersion = new global::System.Version("3.0.4.5");
string dslVersionStr = reader.GetAttribute("dslVersion");
if (dslVersionStr != null)
{
diff --git a/src/DslPackage/DslPackage.csproj b/src/DslPackage/DslPackage.csproj
index 84119664f..e5aaa58b3 100644
--- a/src/DslPackage/DslPackage.csproj
+++ b/src/DslPackage/DslPackage.csproj
@@ -244,6 +244,18 @@
true
+
+
+
+
+
+
+
+
+
+
+
+
VsctGenerator
@@ -395,6 +407,7 @@
true
+
diff --git a/src/DslPackage/GeneratedCode/Constants.cs b/src/DslPackage/GeneratedCode/Constants.cs
index b2ee940ca..455f30012 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 = "3.0.4.4";
+ public const string ProductVersion = "3.0.4.5";
// 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/Parsers/EF6Parser.exe b/src/DslPackage/Parsers/EF6Parser.exe
index 7c761de3a..930eb5c2c 100644
Binary files a/src/DslPackage/Parsers/EF6Parser.exe and b/src/DslPackage/Parsers/EF6Parser.exe differ
diff --git a/src/DslPackage/Parsers/EFCore2Parser.exe b/src/DslPackage/Parsers/EFCore2Parser.exe
index 8f4db0d1e..585fe18db 100644
Binary files a/src/DslPackage/Parsers/EFCore2Parser.exe and b/src/DslPackage/Parsers/EFCore2Parser.exe differ
diff --git a/src/DslPackage/Parsers/EFCore3Parser.exe b/src/DslPackage/Parsers/EFCore3Parser.exe
index 75aa9f475..c8ae07298 100644
Binary files a/src/DslPackage/Parsers/EFCore3Parser.exe and b/src/DslPackage/Parsers/EFCore3Parser.exe differ
diff --git a/src/DslPackage/Parsers/EFCore5Parser.exe b/src/DslPackage/Parsers/EFCore5Parser.exe
index 5654a0991..f9bc3ee3c 100644
Binary files a/src/DslPackage/Parsers/EFCore5Parser.exe and b/src/DslPackage/Parsers/EFCore5Parser.exe differ
diff --git a/src/DslPackage/TextTemplates/EF6Designer.ttinclude b/src/DslPackage/TextTemplates/EF6Designer.ttinclude
index d1212998f..a1e1e070a 100644
--- a/src/DslPackage/TextTemplates/EF6Designer.ttinclude
+++ b/src/DslPackage/TextTemplates/EF6Designer.ttinclude
@@ -23,7 +23,7 @@
#><#@ import namespace="System.Data.Entity.Design.PluralizationServices"
#><#@ import namespace="Microsoft.VisualStudio.TextTemplating"
#><#+
-// EFDesigner v3.0.3
+// EFDesigner v3.0.4
// Copyright (c) 2017-2021 Michael Sawczyn
// https://github.com/msawczyn/EFDesigner
diff --git a/src/DslPackage/TextTemplates/EF6ModelGenerator.ttinclude b/src/DslPackage/TextTemplates/EF6ModelGenerator.ttinclude
index e099b443e..cd7f402fe 100644
--- a/src/DslPackage/TextTemplates/EF6ModelGenerator.ttinclude
+++ b/src/DslPackage/TextTemplates/EF6ModelGenerator.ttinclude
@@ -23,7 +23,7 @@
#><#@ import namespace="System.Data.Entity.Design.PluralizationServices"
#><#@ import namespace="Microsoft.VisualStudio.TextTemplating"
#><#+
- // EFDesigner v3.0.3
+ // EFDesigner v3.0.4
// Copyright (c) 2017-2021 Michael Sawczyn
// https://github.com/msawczyn/EFDesigner
diff --git a/src/DslPackage/TextTemplates/EFCore2ModelGenerator.ttinclude b/src/DslPackage/TextTemplates/EFCore2ModelGenerator.ttinclude
index fc1e16a82..fd52c6838 100644
--- a/src/DslPackage/TextTemplates/EFCore2ModelGenerator.ttinclude
+++ b/src/DslPackage/TextTemplates/EFCore2ModelGenerator.ttinclude
@@ -23,7 +23,7 @@
#><#@ import namespace="System.Data.Entity.Design.PluralizationServices"
#><#@ import namespace="Microsoft.VisualStudio.TextTemplating"
#><#+
- // EFDesigner v3.0.3
+ // EFDesigner v3.0.4
// Copyright (c) 2017-2021 Michael Sawczyn
// https://github.com/msawczyn/EFDesigner
diff --git a/src/DslPackage/TextTemplates/EFCore3ModelGenerator.ttinclude b/src/DslPackage/TextTemplates/EFCore3ModelGenerator.ttinclude
index 79c81a265..7eb341198 100644
--- a/src/DslPackage/TextTemplates/EFCore3ModelGenerator.ttinclude
+++ b/src/DslPackage/TextTemplates/EFCore3ModelGenerator.ttinclude
@@ -23,7 +23,7 @@
#><#@ import namespace="System.Data.Entity.Design.PluralizationServices"
#><#@ import namespace="Microsoft.VisualStudio.TextTemplating"
#><#+
- // EFDesigner v3.0.3
+ // EFDesigner v3.0.4
// Copyright (c) 2017-2021 Michael Sawczyn
// https://github.com/msawczyn/EFDesigner
diff --git a/src/DslPackage/TextTemplates/EFCore5ModelGenerator.ttinclude b/src/DslPackage/TextTemplates/EFCore5ModelGenerator.ttinclude
index 930a2f263..53342e6b6 100644
--- a/src/DslPackage/TextTemplates/EFCore5ModelGenerator.ttinclude
+++ b/src/DslPackage/TextTemplates/EFCore5ModelGenerator.ttinclude
@@ -23,7 +23,7 @@
#><#@ import namespace="System.Data.Entity.Design.PluralizationServices"
#><#@ import namespace="Microsoft.VisualStudio.TextTemplating"
#><#+
- // EFDesigner v3.0.3
+ // EFDesigner v3.0.4
// Copyright (c) 2017-2021 Michael Sawczyn
// https://github.com/msawczyn/EFDesigner
@@ -63,8 +63,8 @@
{
string enumName = modelAttribute.InitialValue.Split('.').First();
string enumValue = modelAttribute.InitialValue.Split('.').Last();
- string enumFQN = modelAttribute.ModelClass.ModelRoot.Enums.FirstOrDefault(e => e.Name == enumName).FullName;
- segments.Add($"HasDefaultValue({enumFQN}.{enumValue.Trim()})");
+ string enumFQN = modelAttribute.ModelClass.ModelRoot.Enums.FirstOrDefault(e => e.Name == enumName)?.FullName ?? enumName;
+ segments.Add($"HasDefaultValue({enumFQN.Trim()}.{enumValue.Trim()})");
}
else
{
diff --git a/src/DslPackage/TextTemplates/EFCoreDesigner.ttinclude b/src/DslPackage/TextTemplates/EFCoreDesigner.ttinclude
index d1212998f..a1e1e070a 100644
--- a/src/DslPackage/TextTemplates/EFCoreDesigner.ttinclude
+++ b/src/DslPackage/TextTemplates/EFCoreDesigner.ttinclude
@@ -23,7 +23,7 @@
#><#@ import namespace="System.Data.Entity.Design.PluralizationServices"
#><#@ import namespace="Microsoft.VisualStudio.TextTemplating"
#><#+
-// EFDesigner v3.0.3
+// EFDesigner v3.0.4
// Copyright (c) 2017-2021 Michael Sawczyn
// https://github.com/msawczyn/EFDesigner
diff --git a/src/DslPackage/TextTemplates/EFCoreModelGenerator.ttinclude b/src/DslPackage/TextTemplates/EFCoreModelGenerator.ttinclude
index 70f0ea8fd..f290506c4 100644
--- a/src/DslPackage/TextTemplates/EFCoreModelGenerator.ttinclude
+++ b/src/DslPackage/TextTemplates/EFCoreModelGenerator.ttinclude
@@ -23,7 +23,7 @@
#><#@ import namespace="System.Data.Entity.Design.PluralizationServices"
#><#@ import namespace="Microsoft.VisualStudio.TextTemplating"
#><#+
- // EFDesigner v3.0.3
+ // EFDesigner v3.0.4
// Copyright (c) 2017-2021 Michael Sawczyn
// https://github.com/msawczyn/EFDesigner
diff --git a/src/DslPackage/TextTemplates/EFDesigner.ttinclude b/src/DslPackage/TextTemplates/EFDesigner.ttinclude
index b7d309267..8dd186159 100644
--- a/src/DslPackage/TextTemplates/EFDesigner.ttinclude
+++ b/src/DslPackage/TextTemplates/EFDesigner.ttinclude
@@ -23,7 +23,7 @@
#><#@ import namespace="System.Data.Entity.Design.PluralizationServices"
#><#@ import namespace="Microsoft.VisualStudio.TextTemplating"
#><#+
- // EFDesigner v3.0.3
+ // EFDesigner v3.0.4
// Copyright (c) 2017-2021 Michael Sawczyn
// https://github.com/msawczyn/EFDesigner
diff --git a/src/DslPackage/TextTemplates/EFModelFileManager.ttinclude b/src/DslPackage/TextTemplates/EFModelFileManager.ttinclude
index 52aca5ce4..665408e53 100644
--- a/src/DslPackage/TextTemplates/EFModelFileManager.ttinclude
+++ b/src/DslPackage/TextTemplates/EFModelFileManager.ttinclude
@@ -23,7 +23,7 @@
#><#@ import namespace="System.Data.Entity.Design.PluralizationServices"
#><#@ import namespace="Microsoft.VisualStudio.TextTemplating"
#><#+
- // EFDesigner v3.0.3
+ // EFDesigner v3.0.4
// Copyright (c) 2017-2021 Michael Sawczyn
// https://github.com/msawczyn/EFDesigner
diff --git a/src/DslPackage/TextTemplates/EFModelGenerator.ttinclude b/src/DslPackage/TextTemplates/EFModelGenerator.ttinclude
index a091e24b8..59fd186ef 100644
--- a/src/DslPackage/TextTemplates/EFModelGenerator.ttinclude
+++ b/src/DslPackage/TextTemplates/EFModelGenerator.ttinclude
@@ -23,7 +23,7 @@
#><#@ import namespace="System.Data.Entity.Design.PluralizationServices"
#><#@ import namespace="Microsoft.VisualStudio.TextTemplating"
#><#+
- // EFDesigner v3.0.3
+ // EFDesigner v3.0.4
// Copyright (c) 2017-2021 Michael Sawczyn
// https://github.com/msawczyn/EFDesigner
@@ -430,6 +430,9 @@
? x.InitialValue.Trim(quote[0])
: x.InitialValue);
+ if (x.FQPrimitiveType == "decimal")
+ value += "m";
+
return $"{x.FQPrimitiveType} {x.Name.ToLower()} = {quote}{value}{quote}";
}));
}
@@ -700,9 +703,14 @@
? "'"
: string.Empty;
+ string initialValue = modelAttribute.InitialValue;
+
+ if (modelAttribute.Type == "decimal")
+ initialValue += "m";
+
Output(quote.Length > 0
- ? $"this.{modelAttribute.Name} = {quote}{FullyQualified(modelAttribute.InitialValue.Trim(quote[0]))}{quote};"
- : $"this.{modelAttribute.Name} = {quote}{FullyQualified(modelAttribute.InitialValue)}{quote};");
+ ? $"this.{modelAttribute.Name} = {quote}{FullyQualified(initialValue.Trim(quote[0]))}{quote};"
+ : $"this.{modelAttribute.Name} = {quote}{FullyQualified(initialValue)}{quote};");
}
// all required navigation properties that aren't a 1..1 relationship
@@ -714,9 +722,12 @@
string parameterName = requiredNavigationProperty.PropertyName.ToLower();
Output($"if ({parameterName} == null) throw new ArgumentNullException(nameof({parameterName}));");
- Output(requiredNavigationProperty.IsCollection
- ? $"{requiredNavigationProperty.PropertyName}.Add({parameterName});"
- : $"this.{requiredNavigationProperty.PropertyName} = {parameterName};");
+ if (!requiredNavigationProperty.ConstructorParameterOnly)
+ {
+ Output(requiredNavigationProperty.IsCollection
+ ? $"{requiredNavigationProperty.PropertyName}.Add({parameterName});"
+ : $"this.{requiredNavigationProperty.PropertyName} = {parameterName};");
+ }
if (!string.IsNullOrEmpty(otherSide.PropertyName))
{
@@ -781,11 +792,10 @@
&& x.SetterVisibility == SetterAccessModifier.Public))
Output($@"/// {string.Join(" ", GenerateCommentBody(requiredAttribute.Summary))}");
- // TODO: Add comment if available
foreach (NavigationProperty requiredNavigationProperty in modelClass.AllRequiredNavigationProperties()
.Where(np => np.AssociationObject.SourceMultiplicity != Sawczyn.EFDesigner.EFModel.Multiplicity.One
|| np.AssociationObject.TargetMultiplicity != Sawczyn.EFDesigner.EFModel.Multiplicity.One))
- Output($@"/// ");
+ Output($@"/// {string.Join(" ", GenerateCommentBody(requiredNavigationProperty.Summary))}");
}
protected void WriteDbContextComments()
@@ -820,10 +830,14 @@
: modelAttribute.Type == "Char"
? "'"
: string.Empty;
+ string initialValue = modelAttribute.InitialValue;
+
+ if (modelAttribute.Type == "decimal")
+ initialValue += "m";
Output(quote.Length == 1
- ? $"{modelAttribute.Name} = {quote}{FullyQualified(modelAttribute.InitialValue.Trim(quote[0]))}{quote};"
- : $"{modelAttribute.Name} = {quote}{FullyQualified(modelAttribute.InitialValue)}{quote};");
+ ? $"{modelAttribute.Name} = {quote}{FullyQualified(initialValue.Trim(quote[0]))}{quote};"
+ : $"{modelAttribute.Name} = {quote}{FullyQualified(initialValue)}{quote};");
++lineCount;
}
@@ -1105,7 +1119,12 @@
? "'"
: string.Empty;
- segments.Add($"Default value = {quote}{FullyQualified(modelAttribute.InitialValue.Trim('"'))}{quote}");
+ string initialValue = modelAttribute.InitialValue;
+
+ if (modelAttribute.Type == "decimal")
+ initialValue += "m";
+
+ segments.Add($"Default value = {quote}{FullyQualified(initialValue.Trim('"'))}{quote}");
}
string nullable = IsNullable(modelAttribute)
diff --git a/src/DslPackage/TextTemplates/EditingOnly/EF6Designer.cs b/src/DslPackage/TextTemplates/EditingOnly/EF6Designer.cs
index 2d8db31c0..b7781e41f 100644
--- a/src/DslPackage/TextTemplates/EditingOnly/EF6Designer.cs
+++ b/src/DslPackage/TextTemplates/EditingOnly/EF6Designer.cs
@@ -1,5 +1,5 @@
#region Template
-// EFDesigner v3.0.3
+// EFDesigner v3.0.4
// Copyright (c) 2017-2021 Michael Sawczyn
// https://github.com/msawczyn/EFDesigner
diff --git a/src/DslPackage/TextTemplates/EditingOnly/EF6ModelGenerator.cs b/src/DslPackage/TextTemplates/EditingOnly/EF6ModelGenerator.cs
index 74a66b7e8..278ecc7d8 100644
--- a/src/DslPackage/TextTemplates/EditingOnly/EF6ModelGenerator.cs
+++ b/src/DslPackage/TextTemplates/EditingOnly/EF6ModelGenerator.cs
@@ -11,7 +11,7 @@ namespace Sawczyn.EFDesigner.EFModel.EditingOnly
public partial class GeneratedTextTransformation
{
#region Template
- // EFDesigner v3.0.3
+ // EFDesigner v3.0.4
// Copyright (c) 2017-2021 Michael Sawczyn
// https://github.com/msawczyn/EFDesigner
diff --git a/src/DslPackage/TextTemplates/EditingOnly/EFCore2ModelGenerator.cs b/src/DslPackage/TextTemplates/EditingOnly/EFCore2ModelGenerator.cs
index fb0587bf5..2b22c3160 100644
--- a/src/DslPackage/TextTemplates/EditingOnly/EFCore2ModelGenerator.cs
+++ b/src/DslPackage/TextTemplates/EditingOnly/EFCore2ModelGenerator.cs
@@ -3,7 +3,7 @@ namespace Sawczyn.EFDesigner.EFModel.EditingOnly
public partial class GeneratedTextTransformation
{
#region Template
- // EFDesigner v3.0.3
+ // EFDesigner v3.0.4
// Copyright (c) 2017-2021 Michael Sawczyn
// https://github.com/msawczyn/EFDesigner
diff --git a/src/DslPackage/TextTemplates/EditingOnly/EFCore3ModelGenerator.cs b/src/DslPackage/TextTemplates/EditingOnly/EFCore3ModelGenerator.cs
index 334f5e2a3..95e9e727a 100644
--- a/src/DslPackage/TextTemplates/EditingOnly/EFCore3ModelGenerator.cs
+++ b/src/DslPackage/TextTemplates/EditingOnly/EFCore3ModelGenerator.cs
@@ -6,7 +6,7 @@ public partial class GeneratedTextTransformation
{
#region Template
- // EFDesigner v3.0.3
+ // EFDesigner v3.0.4
// Copyright (c) 2017-2021 Michael Sawczyn
// https://github.com/msawczyn/EFDesigner
diff --git a/src/DslPackage/TextTemplates/EditingOnly/EFCore5ModelGenerator.cs b/src/DslPackage/TextTemplates/EditingOnly/EFCore5ModelGenerator.cs
index e20022be8..4e528a0ab 100644
--- a/src/DslPackage/TextTemplates/EditingOnly/EFCore5ModelGenerator.cs
+++ b/src/DslPackage/TextTemplates/EditingOnly/EFCore5ModelGenerator.cs
@@ -8,7 +8,7 @@ namespace Sawczyn.EFDesigner.EFModel.EditingOnly
public partial class GeneratedTextTransformation
{
#region Template
- // EFDesigner v3.0.3
+ // EFDesigner v3.0.4
// Copyright (c) 2017-2021 Michael Sawczyn
// https://github.com/msawczyn/EFDesigner
@@ -48,8 +48,8 @@ protected override List GatherModelAttributeSegments(ModelAttribute mode
{
string enumName = modelAttribute.InitialValue.Split('.').First();
string enumValue = modelAttribute.InitialValue.Split('.').Last();
- string enumFQN = modelAttribute.ModelClass.ModelRoot.Enums.FirstOrDefault(e => e.Name == enumName).FullName;
- segments.Add($"HasDefaultValue({enumFQN}.{enumValue.Trim()})");
+ string enumFQN = modelAttribute.ModelClass.ModelRoot.Enums.FirstOrDefault(e => e.Name == enumName)?.FullName ?? enumName;
+ segments.Add($"HasDefaultValue({enumFQN.Trim()}.{enumValue.Trim()})");
}
else
{
diff --git a/src/DslPackage/TextTemplates/EditingOnly/EFCoreDesigner.cs b/src/DslPackage/TextTemplates/EditingOnly/EFCoreDesigner.cs
index 2d8db31c0..b7781e41f 100644
--- a/src/DslPackage/TextTemplates/EditingOnly/EFCoreDesigner.cs
+++ b/src/DslPackage/TextTemplates/EditingOnly/EFCoreDesigner.cs
@@ -1,5 +1,5 @@
#region Template
-// EFDesigner v3.0.3
+// EFDesigner v3.0.4
// Copyright (c) 2017-2021 Michael Sawczyn
// https://github.com/msawczyn/EFDesigner
diff --git a/src/DslPackage/TextTemplates/EditingOnly/EFCoreModelGenerator.cs b/src/DslPackage/TextTemplates/EditingOnly/EFCoreModelGenerator.cs
index dc8745ea2..ab6ac87b5 100644
--- a/src/DslPackage/TextTemplates/EditingOnly/EFCoreModelGenerator.cs
+++ b/src/DslPackage/TextTemplates/EditingOnly/EFCoreModelGenerator.cs
@@ -11,7 +11,7 @@ namespace Sawczyn.EFDesigner.EFModel.EditingOnly
public partial class GeneratedTextTransformation
{
#region Template
- // EFDesigner v3.0.3
+ // EFDesigner v3.0.4
// Copyright (c) 2017-2021 Michael Sawczyn
// https://github.com/msawczyn/EFDesigner
diff --git a/src/DslPackage/TextTemplates/EditingOnly/EFDesigner.cs b/src/DslPackage/TextTemplates/EditingOnly/EFDesigner.cs
index df753d685..2c9c0338f 100644
--- a/src/DslPackage/TextTemplates/EditingOnly/EFDesigner.cs
+++ b/src/DslPackage/TextTemplates/EditingOnly/EFDesigner.cs
@@ -25,7 +25,7 @@ public void WriteLine(string textToAppend) { }
#region Template
- // EFDesigner v3.0.3
+ // EFDesigner v3.0.4
// Copyright (c) 2017-2021 Michael Sawczyn
// https://github.com/msawczyn/EFDesigner
diff --git a/src/DslPackage/TextTemplates/EditingOnly/EFModelFileManager.cs b/src/DslPackage/TextTemplates/EditingOnly/EFModelFileManager.cs
index bbdcaaa3d..0dcd15e87 100644
--- a/src/DslPackage/TextTemplates/EditingOnly/EFModelFileManager.cs
+++ b/src/DslPackage/TextTemplates/EditingOnly/EFModelFileManager.cs
@@ -16,7 +16,7 @@ public partial class GeneratedTextTransformation
{
#region Template
- // EFDesigner v3.0.3
+ // EFDesigner v3.0.4
// Copyright (c) 2017-2021 Michael Sawczyn
// https://github.com/msawczyn/EFDesigner
diff --git a/src/DslPackage/TextTemplates/EditingOnly/EFModelGenerator.cs b/src/DslPackage/TextTemplates/EditingOnly/EFModelGenerator.cs
index e877c56c1..763c58c7c 100644
--- a/src/DslPackage/TextTemplates/EditingOnly/EFModelGenerator.cs
+++ b/src/DslPackage/TextTemplates/EditingOnly/EFModelGenerator.cs
@@ -12,7 +12,7 @@ namespace Sawczyn.EFDesigner.EFModel.EditingOnly
public partial class GeneratedTextTransformation
{
#region Template
- // EFDesigner v3.0.3
+ // EFDesigner v3.0.4
// Copyright (c) 2017-2021 Michael Sawczyn
// https://github.com/msawczyn/EFDesigner
@@ -419,6 +419,9 @@ protected List GetRequiredParameters(ModelClass modelClass, bool? haveDe
? x.InitialValue.Trim(quote[0])
: x.InitialValue);
+ if (x.FQPrimitiveType == "decimal")
+ value += "m";
+
return $"{x.FQPrimitiveType} {x.Name.ToLower()} = {quote}{value}{quote}";
}));
}
@@ -689,9 +692,14 @@ protected void WriteConstructor(ModelClass modelClass)
? "'"
: string.Empty;
+ string initialValue = modelAttribute.InitialValue;
+
+ if (modelAttribute.Type == "decimal")
+ initialValue += "m";
+
Output(quote.Length > 0
- ? $"this.{modelAttribute.Name} = {quote}{FullyQualified(modelAttribute.InitialValue.Trim(quote[0]))}{quote};"
- : $"this.{modelAttribute.Name} = {quote}{FullyQualified(modelAttribute.InitialValue)}{quote};");
+ ? $"this.{modelAttribute.Name} = {quote}{FullyQualified(initialValue.Trim(quote[0]))}{quote};"
+ : $"this.{modelAttribute.Name} = {quote}{FullyQualified(initialValue)}{quote};");
}
// all required navigation properties that aren't a 1..1 relationship
@@ -703,9 +711,12 @@ protected void WriteConstructor(ModelClass modelClass)
string parameterName = requiredNavigationProperty.PropertyName.ToLower();
Output($"if ({parameterName} == null) throw new ArgumentNullException(nameof({parameterName}));");
- Output(requiredNavigationProperty.IsCollection
- ? $"{requiredNavigationProperty.PropertyName}.Add({parameterName});"
- : $"this.{requiredNavigationProperty.PropertyName} = {parameterName};");
+ if (!requiredNavigationProperty.ConstructorParameterOnly)
+ {
+ Output(requiredNavigationProperty.IsCollection
+ ? $"{requiredNavigationProperty.PropertyName}.Add({parameterName});"
+ : $"this.{requiredNavigationProperty.PropertyName} = {parameterName};");
+ }
if (!string.IsNullOrEmpty(otherSide.PropertyName))
{
@@ -770,11 +781,10 @@ protected void WriteConstructorComments(ModelClass modelClass)
&& x.SetterVisibility == SetterAccessModifier.Public))
Output($@"/// {string.Join(" ", GenerateCommentBody(requiredAttribute.Summary))}");
- // TODO: Add comment if available
foreach (NavigationProperty requiredNavigationProperty in modelClass.AllRequiredNavigationProperties()
.Where(np => np.AssociationObject.SourceMultiplicity != Sawczyn.EFDesigner.EFModel.Multiplicity.One
|| np.AssociationObject.TargetMultiplicity != Sawczyn.EFDesigner.EFModel.Multiplicity.One))
- Output($@"/// ");
+ Output($@"/// {string.Join(" ", GenerateCommentBody(requiredNavigationProperty.Summary))}");
}
protected void WriteDbContextComments()
@@ -809,10 +819,14 @@ protected void WriteDefaultConstructorBody(ModelClass modelClass)
: modelAttribute.Type == "Char"
? "'"
: string.Empty;
+ string initialValue = modelAttribute.InitialValue;
+
+ if (modelAttribute.Type == "decimal")
+ initialValue += "m";
Output(quote.Length == 1
- ? $"{modelAttribute.Name} = {quote}{FullyQualified(modelAttribute.InitialValue.Trim(quote[0]))}{quote};"
- : $"{modelAttribute.Name} = {quote}{FullyQualified(modelAttribute.InitialValue)}{quote};");
+ ? $"{modelAttribute.Name} = {quote}{FullyQualified(initialValue.Trim(quote[0]))}{quote};"
+ : $"{modelAttribute.Name} = {quote}{FullyQualified(initialValue)}{quote};");
++lineCount;
}
@@ -1094,7 +1108,12 @@ protected void WriteProperties(ModelClass modelClass)
? "'"
: string.Empty;
- segments.Add($"Default value = {quote}{FullyQualified(modelAttribute.InitialValue.Trim('"'))}{quote}");
+ string initialValue = modelAttribute.InitialValue;
+
+ if (modelAttribute.Type == "decimal")
+ initialValue += "m";
+
+ segments.Add($"Default value = {quote}{FullyQualified(initialValue.Trim('"'))}{quote}");
}
string nullable = IsNullable(modelAttribute)
diff --git a/src/DslPackage/TextTemplates/EditingOnly/MultipleOutputHelper.cs b/src/DslPackage/TextTemplates/EditingOnly/MultipleOutputHelper.cs
index 6450af048..7f60cd76e 100644
--- a/src/DslPackage/TextTemplates/EditingOnly/MultipleOutputHelper.cs
+++ b/src/DslPackage/TextTemplates/EditingOnly/MultipleOutputHelper.cs
@@ -1,5 +1,5 @@
#region Template
-// EFDesigner v3.0.3
+// EFDesigner v3.0.4
// Copyright (c) 2017-2021 Michael Sawczyn
// https://github.com/msawczyn/EFDesigner
diff --git a/src/DslPackage/TextTemplates/EditingOnly/VSIntegration.cs b/src/DslPackage/TextTemplates/EditingOnly/VSIntegration.cs
index 09e28a052..f2939d39f 100644
--- a/src/DslPackage/TextTemplates/EditingOnly/VSIntegration.cs
+++ b/src/DslPackage/TextTemplates/EditingOnly/VSIntegration.cs
@@ -14,7 +14,7 @@ public partial class GeneratedTextTransformation
{
#region Template
- // EFDesigner v3.0.3
+ // EFDesigner v3.0.4
// Copyright (c) 2017-2021 Michael Sawczyn
// https://github.com/msawczyn/EFDesigner
diff --git a/src/DslPackage/TextTemplates/MultipleOutputHelper.ttinclude b/src/DslPackage/TextTemplates/MultipleOutputHelper.ttinclude
index d1212998f..a1e1e070a 100644
--- a/src/DslPackage/TextTemplates/MultipleOutputHelper.ttinclude
+++ b/src/DslPackage/TextTemplates/MultipleOutputHelper.ttinclude
@@ -23,7 +23,7 @@
#><#@ import namespace="System.Data.Entity.Design.PluralizationServices"
#><#@ import namespace="Microsoft.VisualStudio.TextTemplating"
#><#+
-// EFDesigner v3.0.3
+// EFDesigner v3.0.4
// Copyright (c) 2017-2021 Michael Sawczyn
// https://github.com/msawczyn/EFDesigner
diff --git a/src/DslPackage/TextTemplates/VSIntegration.ttinclude b/src/DslPackage/TextTemplates/VSIntegration.ttinclude
index ea0cb9d1a..7af8e58b2 100644
--- a/src/DslPackage/TextTemplates/VSIntegration.ttinclude
+++ b/src/DslPackage/TextTemplates/VSIntegration.ttinclude
@@ -23,7 +23,7 @@
#><#@ import namespace="System.Data.Entity.Design.PluralizationServices"
#><#@ import namespace="Microsoft.VisualStudio.TextTemplating"
#><#+
- // EFDesigner v3.0.3
+ // EFDesigner v3.0.4
// Copyright (c) 2017-2021 Michael Sawczyn
// https://github.com/msawczyn/EFDesigner
diff --git a/src/DslPackage/source.extension.vsixmanifest b/src/DslPackage/source.extension.vsixmanifest
index f7b6dc034..766ae7177 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/EF6/EF6NetCore3/AllFeatureModel.cs b/src/Testing/EF6/EF6NetCore3/AllFeatureModel.cs
index 6153a7d78..eed1f8ddf 100644
--- a/src/Testing/EF6/EF6NetCore3/AllFeatureModel.cs
+++ b/src/Testing/EF6/EF6NetCore3/AllFeatureModel.cs
@@ -1 +1,1778 @@
+//------------------------------------------------------------------------------
+//
+// 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;
+using System.Data.Entity.Spatial;
+
+namespace Testing
+{
+ public partial class AllPropertyTypesRequired
+ {
+ partial void Init();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected AllPropertyTypesRequired()
+ {
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static AllPropertyTypesRequired CreateAllPropertyTypesRequiredUnsafe()
+ {
+ return new AllPropertyTypesRequired();
+ }
+
+ ///
+ /// 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, TimeSpan timeattr, string stringattr)
+ {
+ this.BinaryAttr = binaryattr;
+
+ this.BooleanAttr = booleanattr;
+
+ this.ByteAttr = byteattr;
+
+ this.DateTimeAttr = datetimeattr;
+
+ this.DateTimeOffsetAttr = datetimeoffsetattr;
+
+ this.DecimalAttr = decimalattr;
+
+ this.DoubleAttr = doubleattr;
+
+ this.GuidAttr = guidattr;
+
+ this.Int16Attr = int16attr;
+
+ this.Int32Attr = int32attr;
+
+ this.Int64Attr = int64attr;
+
+ this.SingleAttr = singleattr;
+
+ this.TimeAttr = timeattr;
+
+ if (string.IsNullOrEmpty(stringattr)) throw new ArgumentNullException(nameof(stringattr));
+ this.StringAttr = stringattr;
+
+ 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, TimeSpan timeattr, string stringattr)
+ {
+ return new AllPropertyTypesRequired(binaryattr, booleanattr, byteattr, datetimeattr, datetimeoffsetattr, decimalattr, doubleattr, guidattr, int16attr, int32attr, int64attr, singleattr, timeattr, stringattr);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for Id
+ ///
+ protected int _id;
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ ///
+ partial void SetId(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ ///
+ partial void GetId(ref int result);
+
+ ///
+ /// Identity, Required
+ ///
+ [Key]
+ [Required]
+ public int Id
+ {
+ get
+ {
+ int value = _id;
+ GetId(ref value);
+ return (_id = value);
+ }
+ set
+ {
+ int oldValue = _id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _id = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for BinaryAttr
+ ///
+ protected byte[] _binaryAttr;
+ ///
+ /// When provided in a partial class, allows value of BinaryAttr to be changed before setting.
+ ///
+ partial void SetBinaryAttr(byte[] oldValue, ref byte[] newValue);
+ ///
+ /// When provided in a partial class, allows value of BinaryAttr to be changed before returning.
+ ///
+ partial void GetBinaryAttr(ref byte[] result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public byte[] BinaryAttr
+ {
+ get
+ {
+ byte[] value = _binaryAttr;
+ GetBinaryAttr(ref value);
+ return (_binaryAttr = value);
+ }
+ set
+ {
+ byte[] oldValue = _binaryAttr;
+ SetBinaryAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _binaryAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for BooleanAttr
+ ///
+ protected bool _booleanAttr;
+ ///
+ /// When provided in a partial class, allows value of BooleanAttr to be changed before setting.
+ ///
+ partial void SetBooleanAttr(bool oldValue, ref bool newValue);
+ ///
+ /// When provided in a partial class, allows value of BooleanAttr to be changed before returning.
+ ///
+ partial void GetBooleanAttr(ref bool result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public bool BooleanAttr
+ {
+ get
+ {
+ bool value = _booleanAttr;
+ GetBooleanAttr(ref value);
+ return (_booleanAttr = value);
+ }
+ set
+ {
+ bool oldValue = _booleanAttr;
+ SetBooleanAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _booleanAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for ByteAttr
+ ///
+ protected byte _byteAttr;
+ ///
+ /// When provided in a partial class, allows value of ByteAttr to be changed before setting.
+ ///
+ partial void SetByteAttr(byte oldValue, ref byte newValue);
+ ///
+ /// When provided in a partial class, allows value of ByteAttr to be changed before returning.
+ ///
+ partial void GetByteAttr(ref byte result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public byte ByteAttr
+ {
+ get
+ {
+ byte value = _byteAttr;
+ GetByteAttr(ref value);
+ return (_byteAttr = value);
+ }
+ set
+ {
+ byte oldValue = _byteAttr;
+ SetByteAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _byteAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for DateTimeAttr
+ ///
+ protected DateTime _dateTimeAttr;
+ ///
+ /// When provided in a partial class, allows value of DateTimeAttr to be changed before setting.
+ ///
+ partial void SetDateTimeAttr(DateTime oldValue, ref DateTime newValue);
+ ///
+ /// When provided in a partial class, allows value of DateTimeAttr to be changed before returning.
+ ///
+ partial void GetDateTimeAttr(ref DateTime result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public DateTime DateTimeAttr
+ {
+ get
+ {
+ DateTime value = _dateTimeAttr;
+ GetDateTimeAttr(ref value);
+ return (_dateTimeAttr = value);
+ }
+ set
+ {
+ DateTime oldValue = _dateTimeAttr;
+ SetDateTimeAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _dateTimeAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for DateTimeOffsetAttr
+ ///
+ protected DateTimeOffset _dateTimeOffsetAttr;
+ ///
+ /// When provided in a partial class, allows value of DateTimeOffsetAttr to be changed before setting.
+ ///
+ partial void SetDateTimeOffsetAttr(DateTimeOffset oldValue, ref DateTimeOffset newValue);
+ ///
+ /// When provided in a partial class, allows value of DateTimeOffsetAttr to be changed before returning.
+ ///
+ partial void GetDateTimeOffsetAttr(ref DateTimeOffset result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public DateTimeOffset DateTimeOffsetAttr
+ {
+ get
+ {
+ DateTimeOffset value = _dateTimeOffsetAttr;
+ GetDateTimeOffsetAttr(ref value);
+ return (_dateTimeOffsetAttr = value);
+ }
+ set
+ {
+ DateTimeOffset oldValue = _dateTimeOffsetAttr;
+ SetDateTimeOffsetAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _dateTimeOffsetAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for DecimalAttr
+ ///
+ protected decimal _decimalAttr;
+ ///
+ /// When provided in a partial class, allows value of DecimalAttr to be changed before setting.
+ ///
+ partial void SetDecimalAttr(decimal oldValue, ref decimal newValue);
+ ///
+ /// When provided in a partial class, allows value of DecimalAttr to be changed before returning.
+ ///
+ partial void GetDecimalAttr(ref decimal result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public decimal DecimalAttr
+ {
+ get
+ {
+ decimal value = _decimalAttr;
+ GetDecimalAttr(ref value);
+ return (_decimalAttr = value);
+ }
+ set
+ {
+ decimal oldValue = _decimalAttr;
+ SetDecimalAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _decimalAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for DoubleAttr
+ ///
+ protected double _doubleAttr;
+ ///
+ /// When provided in a partial class, allows value of DoubleAttr to be changed before setting.
+ ///
+ partial void SetDoubleAttr(double oldValue, ref double newValue);
+ ///
+ /// When provided in a partial class, allows value of DoubleAttr to be changed before returning.
+ ///
+ partial void GetDoubleAttr(ref double result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public double DoubleAttr
+ {
+ get
+ {
+ double value = _doubleAttr;
+ GetDoubleAttr(ref value);
+ return (_doubleAttr = value);
+ }
+ set
+ {
+ double oldValue = _doubleAttr;
+ SetDoubleAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _doubleAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for GuidAttr
+ ///
+ protected Guid _guidAttr;
+ ///
+ /// When provided in a partial class, allows value of GuidAttr to be changed before setting.
+ ///
+ partial void SetGuidAttr(Guid oldValue, ref Guid newValue);
+ ///
+ /// When provided in a partial class, allows value of GuidAttr to be changed before returning.
+ ///
+ partial void GetGuidAttr(ref Guid result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public Guid GuidAttr
+ {
+ get
+ {
+ Guid value = _guidAttr;
+ GetGuidAttr(ref value);
+ return (_guidAttr = value);
+ }
+ set
+ {
+ Guid oldValue = _guidAttr;
+ SetGuidAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _guidAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for Int16Attr
+ ///
+ protected short _int16Attr;
+ ///
+ /// When provided in a partial class, allows value of Int16Attr to be changed before setting.
+ ///
+ partial void SetInt16Attr(short oldValue, ref short newValue);
+ ///
+ /// When provided in a partial class, allows value of Int16Attr to be changed before returning.
+ ///
+ partial void GetInt16Attr(ref short result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public short Int16Attr
+ {
+ get
+ {
+ short value = _int16Attr;
+ GetInt16Attr(ref value);
+ return (_int16Attr = value);
+ }
+ set
+ {
+ short oldValue = _int16Attr;
+ SetInt16Attr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _int16Attr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for Int32Attr
+ ///
+ protected int _int32Attr;
+ ///
+ /// When provided in a partial class, allows value of Int32Attr to be changed before setting.
+ ///
+ partial void SetInt32Attr(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Int32Attr to be changed before returning.
+ ///
+ partial void GetInt32Attr(ref int result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public int Int32Attr
+ {
+ get
+ {
+ int value = _int32Attr;
+ GetInt32Attr(ref value);
+ return (_int32Attr = value);
+ }
+ set
+ {
+ int oldValue = _int32Attr;
+ SetInt32Attr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _int32Attr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for Int64Attr
+ ///
+ protected long _int64Attr;
+ ///
+ /// When provided in a partial class, allows value of Int64Attr to be changed before setting.
+ ///
+ partial void SetInt64Attr(long oldValue, ref long newValue);
+ ///
+ /// When provided in a partial class, allows value of Int64Attr to be changed before returning.
+ ///
+ partial void GetInt64Attr(ref long result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public long Int64Attr
+ {
+ get
+ {
+ long value = _int64Attr;
+ GetInt64Attr(ref value);
+ return (_int64Attr = value);
+ }
+ set
+ {
+ long oldValue = _int64Attr;
+ SetInt64Attr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _int64Attr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for SingleAttr
+ ///
+ protected Single _singleAttr;
+ ///
+ /// When provided in a partial class, allows value of SingleAttr to be changed before setting.
+ ///
+ partial void SetSingleAttr(Single oldValue, ref Single newValue);
+ ///
+ /// When provided in a partial class, allows value of SingleAttr to be changed before returning.
+ ///
+ partial void GetSingleAttr(ref Single result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public Single SingleAttr
+ {
+ get
+ {
+ Single value = _singleAttr;
+ GetSingleAttr(ref value);
+ return (_singleAttr = value);
+ }
+ set
+ {
+ Single oldValue = _singleAttr;
+ SetSingleAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _singleAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for TimeAttr
+ ///
+ protected TimeSpan _timeAttr;
+ ///
+ /// When provided in a partial class, allows value of TimeAttr to be changed before setting.
+ ///
+ partial void SetTimeAttr(TimeSpan oldValue, ref TimeSpan newValue);
+ ///
+ /// When provided in a partial class, allows value of TimeAttr to be changed before returning.
+ ///
+ partial void GetTimeAttr(ref TimeSpan result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public TimeSpan TimeAttr
+ {
+ get
+ {
+ TimeSpan value = _timeAttr;
+ GetTimeAttr(ref value);
+ return (_timeAttr = value);
+ }
+ set
+ {
+ TimeSpan oldValue = _timeAttr;
+ SetTimeAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _timeAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for StringAttr
+ ///
+ protected string _stringAttr;
+ ///
+ /// When provided in a partial class, allows value of StringAttr to be changed before setting.
+ ///
+ partial void SetStringAttr(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of StringAttr to be changed before returning.
+ ///
+ partial void GetStringAttr(ref string result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public string StringAttr
+ {
+ get
+ {
+ string value = _stringAttr;
+ GetStringAttr(ref value);
+ return (_stringAttr = value);
+ }
+ set
+ {
+ string oldValue = _stringAttr;
+ SetStringAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _stringAttr = value;
+ }
+ }
+ }
+
+ }
+}
+
+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;
+using System.Data.Entity.Spatial;
+
+namespace Testing
+{
+ public partial class AllPropertyTypesOptional
+ {
+ partial void Init();
+
+ ///
+ /// Default constructor
+ ///
+ public AllPropertyTypesOptional()
+ {
+ Init();
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for Id
+ ///
+ protected int _id;
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ ///
+ partial void SetId(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ ///
+ partial void GetId(ref int result);
+
+ ///
+ /// Identity, Required
+ ///
+ [Key]
+ [Required]
+ public int Id
+ {
+ get
+ {
+ int value = _id;
+ GetId(ref value);
+ return (_id = value);
+ }
+ set
+ {
+ int oldValue = _id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _id = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for BinaryAttr
+ ///
+ protected byte[] _binaryAttr;
+ ///
+ /// When provided in a partial class, allows value of BinaryAttr to be changed before setting.
+ ///
+ partial void SetBinaryAttr(byte[] oldValue, ref byte[] newValue);
+ ///
+ /// When provided in a partial class, allows value of BinaryAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _binaryAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for BooleanAttr
+ ///
+ protected bool? _booleanAttr;
+ ///
+ /// When provided in a partial class, allows value of BooleanAttr to be changed before setting.
+ ///
+ partial void SetBooleanAttr(bool? oldValue, ref bool? newValue);
+ ///
+ /// When provided in a partial class, allows value of BooleanAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _booleanAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for ByteAttr
+ ///
+ protected byte? _byteAttr;
+ ///
+ /// When provided in a partial class, allows value of ByteAttr to be changed before setting.
+ ///
+ partial void SetByteAttr(byte? oldValue, ref byte? newValue);
+ ///
+ /// When provided in a partial class, allows value of ByteAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _byteAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for DateTimeAttr
+ ///
+ protected DateTime? _dateTimeAttr;
+ ///
+ /// When provided in a partial class, allows value of DateTimeAttr to be changed before setting.
+ ///
+ partial void SetDateTimeAttr(DateTime? oldValue, ref DateTime? newValue);
+ ///
+ /// When provided in a partial class, allows value of DateTimeAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _dateTimeAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for DateTimeOffsetAttr
+ ///
+ protected DateTimeOffset? _dateTimeOffsetAttr;
+ ///
+ /// When provided in a partial class, allows value of DateTimeOffsetAttr to be changed before setting.
+ ///
+ partial void SetDateTimeOffsetAttr(DateTimeOffset? oldValue, ref DateTimeOffset? newValue);
+ ///
+ /// When provided in a partial class, allows value of DateTimeOffsetAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _dateTimeOffsetAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for DecimalAttr
+ ///
+ protected decimal? _decimalAttr;
+ ///
+ /// When provided in a partial class, allows value of DecimalAttr to be changed before setting.
+ ///
+ partial void SetDecimalAttr(decimal? oldValue, ref decimal? newValue);
+ ///
+ /// When provided in a partial class, allows value of DecimalAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _decimalAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for DoubleAttr
+ ///
+ protected double? _doubleAttr;
+ ///
+ /// When provided in a partial class, allows value of DoubleAttr to be changed before setting.
+ ///
+ partial void SetDoubleAttr(double? oldValue, ref double? newValue);
+ ///
+ /// When provided in a partial class, allows value of DoubleAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _doubleAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for GuidAttr
+ ///
+ protected Guid? _guidAttr;
+ ///
+ /// When provided in a partial class, allows value of GuidAttr to be changed before setting.
+ ///
+ partial void SetGuidAttr(Guid? oldValue, ref Guid? newValue);
+ ///
+ /// When provided in a partial class, allows value of GuidAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _guidAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for Int16Attr
+ ///
+ protected short? _int16Attr;
+ ///
+ /// When provided in a partial class, allows value of Int16Attr to be changed before setting.
+ ///
+ partial void SetInt16Attr(short? oldValue, ref short? newValue);
+ ///
+ /// When provided in a partial class, allows value of Int16Attr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _int16Attr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for Int32Attr
+ ///
+ protected int? _int32Attr;
+ ///
+ /// When provided in a partial class, allows value of Int32Attr to be changed before setting.
+ ///
+ partial void SetInt32Attr(int? oldValue, ref int? newValue);
+ ///
+ /// When provided in a partial class, allows value of Int32Attr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _int32Attr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for Int64Attr
+ ///
+ protected long? _int64Attr;
+ ///
+ /// When provided in a partial class, allows value of Int64Attr to be changed before setting.
+ ///
+ partial void SetInt64Attr(long? oldValue, ref long? newValue);
+ ///
+ /// When provided in a partial class, allows value of Int64Attr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _int64Attr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for SingleAttr
+ ///
+ protected Single? _singleAttr;
+ ///
+ /// When provided in a partial class, allows value of SingleAttr to be changed before setting.
+ ///
+ partial void SetSingleAttr(Single? oldValue, ref Single? newValue);
+ ///
+ /// When provided in a partial class, allows value of SingleAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _singleAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for TimeAttr
+ ///
+ protected TimeSpan? _timeAttr;
+ ///
+ /// When provided in a partial class, allows value of TimeAttr to be changed before setting.
+ ///
+ partial void SetTimeAttr(TimeSpan? oldValue, ref TimeSpan? newValue);
+ ///
+ /// When provided in a partial class, allows value of TimeAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _timeAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for StringAttr
+ ///
+ protected string _stringAttr;
+ ///
+ /// When provided in a partial class, allows value of StringAttr to be changed before setting.
+ ///
+ partial void SetStringAttr(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of StringAttr to be changed before returning.
+ ///
+ partial void GetStringAttr(ref string result);
+
+ public string StringAttr
+ {
+ get
+ {
+ string value = _stringAttr;
+ GetStringAttr(ref value);
+ return (_stringAttr = value);
+ }
+ set
+ {
+ string oldValue = _stringAttr;
+ SetStringAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _stringAttr = value;
+ }
+ }
+ }
+
+ }
+}
+
+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;
+using System.Data.Entity.Spatial;
+
+namespace Testing
+{
+ public partial class UParentRequired
+ {
+ partial void Init();
+
+ ///
+ /// Default constructor
+ ///
+ public UParentRequired()
+ {
+ UChildCollection = new System.Collections.ObjectModel.ObservableCollection();
+ UChildRequired = global::Testing.UChild.CreateUChildUnsafe();
+
+ Init();
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for Id
+ ///
+ internal int _id;
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ ///
+ partial void SetId(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ ///
+ partial void GetId(ref int result);
+
+ ///
+ /// Identity, Indexed, Required
+ ///
+ [Key]
+ [Required]
+ public int Id
+ {
+ get
+ {
+ int value = _id;
+ GetId(ref value);
+ return (_id = value);
+ }
+ set
+ {
+ int oldValue = _id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _id = value;
+ }
+ }
+ }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for UChildRequired
+ ///
+ protected global::Testing.UChild _uChildRequired;
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before setting.
+ ///
+ partial void SetUChildRequired(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before returning.
+ ///
+ partial void GetUChildRequired(ref global::Testing.UChild result);
+
+ ///
+ /// Required
+ ///
+ public virtual global::Testing.UChild UChildRequired
+ {
+ get
+ {
+ global::Testing.UChild value = _uChildRequired;
+ GetUChildRequired(ref value);
+ return (_uChildRequired = value);
+ }
+ set
+ {
+ global::Testing.UChild oldValue = _uChildRequired;
+ SetUChildRequired(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _uChildRequired = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for UChildCollection
+ ///
+ protected ICollection _uChildCollection;
+
+ public virtual ICollection UChildCollection
+ {
+ get
+ {
+ return _uChildCollection;
+ }
+ private set
+ {
+ _uChildCollection = value;
+ }
+ }
+
+ ///
+ /// Backing field for UChildOptional
+ ///
+ protected global::Testing.UChild _uChildOptional;
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before setting.
+ ///
+ partial void SetUChildOptional(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before returning.
+ ///
+ partial void GetUChildOptional(ref global::Testing.UChild result);
+
+ public virtual global::Testing.UChild UChildOptional
+ {
+ get
+ {
+ global::Testing.UChild value = _uChildOptional;
+ GetUChildOptional(ref value);
+ return (_uChildOptional = value);
+ }
+ set
+ {
+ global::Testing.UChild oldValue = _uChildOptional;
+ SetUChildOptional(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _uChildOptional = value;
+ }
+ }
+ }
+
+ }
+}
+
+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;
+using System.Data.Entity.Spatial;
+
+namespace Testing
+{
+ ///
+ /// x
+ ///
+ [System.ComponentModel.Description("x")]
+ public partial class UParentOptional: global::Testing.HiddenEntity
+ {
+ 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.ObjectModel.ObservableCollection();
+ UChildRequired = global::Testing.UChild.CreateUChildUnsafe();
+
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static UParentOptional CreateUParentOptionalUnsafe()
+ {
+ return new UParentOptional();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
+ ///
+ public UParentOptional(global::Testing.UChild uchildrequired)
+ {
+ this.PropertyInChild = "hello";
+ if (uchildrequired == null) throw new ArgumentNullException(nameof(uchildrequired));
+ this.UChildRequired = uchildrequired;
+
+ this.UChildCollection = new System.Collections.ObjectModel.ObservableCollection();
+ Init();
+ }
+
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ ///
+ public static UParentOptional Create(global::Testing.UChild uchildrequired)
+ {
+ return new UParentOptional(uchildrequired);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for PropertyInChild
+ ///
+ protected string _propertyInChild;
+ ///
+ /// When provided in a partial class, allows value of PropertyInChild to be changed before setting.
+ ///
+ partial void SetPropertyInChild(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of PropertyInChild to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _propertyInChild = value;
+ }
+ }
+ }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for UChildOptional
+ ///
+ protected global::Testing.UChild _uChildOptional;
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before setting.
+ ///
+ partial void SetUChildOptional(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before returning.
+ ///
+ partial void GetUChildOptional(ref global::Testing.UChild result);
+
+ ///
+ /// x
+ ///
+ [Description("x")]
+ public virtual global::Testing.UChild UChildOptional
+ {
+ get
+ {
+ global::Testing.UChild value = _uChildOptional;
+ GetUChildOptional(ref value);
+ return (_uChildOptional = value);
+ }
+ set
+ {
+ global::Testing.UChild oldValue = _uChildOptional;
+ SetUChildOptional(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _uChildOptional = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for UChildCollection
+ ///
+ protected ICollection _uChildCollection;
+
+ ///
+ /// h
+ ///
+ [Description("h")]
+ public virtual ICollection UChildCollection
+ {
+ get
+ {
+ return _uChildCollection;
+ }
+ private set
+ {
+ _uChildCollection = value;
+ }
+ }
+
+ ///
+ /// Backing field for UChildRequired
+ ///
+ protected global::Testing.UChild _uChildRequired;
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before setting.
+ ///
+ partial void SetUChildRequired(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before returning.
+ ///
+ partial void GetUChildRequired(ref global::Testing.UChild result);
+
+ ///
+ /// Required
+ ///
+ public virtual global::Testing.UChild UChildRequired
+ {
+ get
+ {
+ global::Testing.UChild value = _uChildRequired;
+ GetUChildRequired(ref value);
+ return (_uChildRequired = value);
+ }
+ set
+ {
+ global::Testing.UChild oldValue = _uChildRequired;
+ SetUChildRequired(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _uChildRequired = value;
+ }
+ }
+ }
+
+ }
+}
+
+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;
+using System.Data.Entity.Spatial;
+
+namespace Testing
+{
+ public partial class UParentCollection
+ {
+ partial void Init();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected UParentCollection()
+ {
+ UChildCollection = new System.Collections.ObjectModel.ObservableCollection();
+ UChildRequired = global::Testing.UChild.CreateUChildUnsafe();
+
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static UParentCollection CreateUParentCollectionUnsafe()
+ {
+ return new UParentCollection();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
+ ///
+ public UParentCollection(global::Testing.UChild uchildrequired)
+ {
+ if (uchildrequired == null) throw new ArgumentNullException(nameof(uchildrequired));
+ this.UChildRequired = uchildrequired;
+
+ this.UChildCollection = new System.Collections.ObjectModel.ObservableCollection();
+ Init();
+ }
+
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ ///
+ public static UParentCollection Create(global::Testing.UChild uchildrequired)
+ {
+ return new UParentCollection(uchildrequired);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for Id
+ ///
+ internal int _id;
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ ///
+ partial void SetId(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ ///
+ partial void GetId(ref int result);
+
+ ///
+ /// Identity, Indexed, Required
+ ///
+ [Key]
+ [Required]
+ public int Id
+ {
+ get
+ {
+ int value = _id;
+ GetId(ref value);
+ return (_id = value);
+ }
+ set
+ {
+ int oldValue = _id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _id = value;
+ }
+ }
+ }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for UChildRequired
+ ///
+ protected global::Testing.UChild _uChildRequired;
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before setting.
+ ///
+ partial void SetUChildRequired(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before returning.
+ ///
+ partial void GetUChildRequired(ref global::Testing.UChild result);
+
+ ///
+ /// Required
+ ///
+ public virtual global::Testing.UChild UChildRequired
+ {
+ get
+ {
+ global::Testing.UChild value = _uChildRequired;
+ GetUChildRequired(ref value);
+ return (_uChildRequired = value);
+ }
+ set
+ {
+ global::Testing.UChild oldValue = _uChildRequired;
+ SetUChildRequired(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _uChildRequired = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for UChildCollection
+ ///
+ protected ICollection _uChildCollection;
+
+ public virtual ICollection UChildCollection
+ {
+ get
+ {
+ return _uChildCollection;
+ }
+ private set
+ {
+ _uChildCollection = value;
+ }
+ }
+
+ ///
+ /// Backing field for UChildOptional
+ ///
+ protected global::Testing.UChild _uChildOptional;
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before setting.
+ ///
+ partial void SetUChildOptional(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before returning.
+ ///
+ partial void GetUChildOptional(ref global::Testing.UChild result);
+
+ public virtual global::Testing.UChild UChildOptional
+ {
+ get
+ {
+ global::Testing.UChild value = _uChildOptional;
+ GetUChildOptional(ref value);
+ return (_uChildOptional = value);
+ }
+ set
+ {
+ global::Testing.UChild oldValue = _uChildOptional;
+ SetUChildOptional(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _uChildOptional = value;
+ }
+ }
+ }
+
+ }
+}
+
+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;
+using System.Data.Entity.Spatial;
+
+namespace Testing
+{
+ public partial class UChild
+ {
+ partial void Init();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected UChild()
+ {
+ // NOTE: This class has one-to-one associations with UChild.
+ // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
+
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static UChild CreateUChildUnsafe()
+ {
+ return new UChild();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
diff --git a/src/Testing/EF6/EF6NetCore3/Generated/Context/AllFeatureModel.generated.cs b/src/Testing/EF6/EF6NetCore3/Generated/Context/AllFeatureModel.generated.cs
index 97aea8b4c..562986eac 100644
--- a/src/Testing/EF6/EF6NetCore3/Generated/Context/AllFeatureModel.generated.cs
+++ b/src/Testing/EF6/EF6NetCore3/Generated/Context/AllFeatureModel.generated.cs
@@ -197,7 +197,7 @@ protected override void OnModelCreating(System.Data.Entity.DbModelBuilder modelB
modelBuilder.Entity().ToTable("Masters").HasKey(t => t.Id);
modelBuilder.Entity().Property(t => t.Id).IsRequired().HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
- modelBuilder.Entity().HasMany(x => x.Children).WithRequired().Map(x => x.MapKey("Master_Children_Id"));
+ modelBuilder.Entity().HasMany(x => x.Children).WithRequired().Map(x => x.MapKey("MasterChildrenId"));
modelBuilder.Entity().ToTable("ParserTests").HasKey(t => t.Id);
modelBuilder.Entity().Property(t => t.Id).IsRequired().HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
@@ -220,13 +220,13 @@ protected override void OnModelCreating(System.Data.Entity.DbModelBuilder modelB
modelBuilder.Entity();
modelBuilder.Entity().HasOptional(x => x.UChildOptional).WithOptionalDependent();
- modelBuilder.Entity().HasMany(x => x.UChildCollection).WithOptional().Map(x => x.MapKey("UParentOptional_UChildCollection_Id"));
+ modelBuilder.Entity().HasMany(x => x.UChildCollection).WithOptional().Map(x => x.MapKey("UParentOptionalUChildCollectionId"));
modelBuilder.Entity().HasRequired(x => x.UChildRequired).WithOptional();
modelBuilder.Entity().ToTable("UParentRequireds").HasKey(t => t.Id);
modelBuilder.Entity().Property(t => t.Id).IsRequired().HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
modelBuilder.Entity().HasRequired(x => x.UChildRequired).WithRequiredDependent();
- modelBuilder.Entity().HasMany(x => x.UChildCollection).WithRequired().Map(x => x.MapKey("UParentRequired_UChildCollection_Id"));
+ modelBuilder.Entity().HasMany(x => x.UChildCollection).WithRequired().Map(x => x.MapKey("UParentRequiredUChildCollectionId"));
modelBuilder.Entity().HasOptional(x => x.UChildOptional).WithRequired().WillCascadeOnDelete(true);
OnModelCreatedImpl(modelBuilder);
diff --git a/src/Testing/EF6/EF6NetCore3/Generated/Entities/AbstractBaseClass.generated.cs b/src/Testing/EF6/EF6NetCore3/Generated/Entities/AbstractBaseClass.generated.cs
index 3353e2694..f4e0834fa 100644
--- a/src/Testing/EF6/EF6NetCore3/Generated/Entities/AbstractBaseClass.generated.cs
+++ b/src/Testing/EF6/EF6NetCore3/Generated/Entities/AbstractBaseClass.generated.cs
@@ -40,7 +40,6 @@ protected AbstractBaseClass(string property0)
if (string.IsNullOrEmpty(property0)) throw new ArgumentNullException(nameof(property0));
this.Property0 = property0;
-
Init();
}
diff --git a/src/Testing/EF6/EF6NetCore3/Generated/Entities/AllPropertyTypesOptional.generated.cs b/src/Testing/EF6/EF6NetCore3/Generated/Entities/AllPropertyTypesOptional.generated.cs
index 842f5c5e4..3d575882d 100644
--- a/src/Testing/EF6/EF6NetCore3/Generated/Entities/AllPropertyTypesOptional.generated.cs
+++ b/src/Testing/EF6/EF6NetCore3/Generated/Entities/AllPropertyTypesOptional.generated.cs
@@ -61,7 +61,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
diff --git a/src/Testing/EF6/EF6NetCore3/Generated/Entities/AllPropertyTypesRequired.generated.cs b/src/Testing/EF6/EF6NetCore3/Generated/Entities/AllPropertyTypesRequired.generated.cs
index 71b7fc2dd..03e7799ea 100644
--- a/src/Testing/EF6/EF6NetCore3/Generated/Entities/AllPropertyTypesRequired.generated.cs
+++ b/src/Testing/EF6/EF6NetCore3/Generated/Entities/AllPropertyTypesRequired.generated.cs
@@ -87,7 +87,6 @@ public AllPropertyTypesRequired(byte[] binaryattr, bool booleanattr, byte byteat
if (string.IsNullOrEmpty(stringattr)) throw new ArgumentNullException(nameof(stringattr));
this.StringAttr = stringattr;
-
Init();
}
@@ -143,7 +142,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
diff --git a/src/Testing/EF6/EF6NetCore3/Generated/Entities/BChild.generated.cs b/src/Testing/EF6/EF6NetCore3/Generated/Entities/BChild.generated.cs
index 7bacb8ea7..f9adfdf0f 100644
--- a/src/Testing/EF6/EF6NetCore3/Generated/Entities/BChild.generated.cs
+++ b/src/Testing/EF6/EF6NetCore3/Generated/Entities/BChild.generated.cs
@@ -61,14 +61,15 @@ public BChild(global::Testing.BParentRequired bparentrequired, global::Testing.B
if (bparentrequired == null) throw new ArgumentNullException(nameof(bparentrequired));
this.BParentRequired = bparentrequired;
+ bparentrequired.BChildOptional = this;
if (bparentrequired_2 == null) throw new ArgumentNullException(nameof(bparentrequired_2));
this.BParentRequired_2 = bparentrequired_2;
+ bparentrequired_2.BChildCollection.Add(this);
this.BParentCollection = new System.Collections.ObjectModel.ObservableCollection();
this.BParentCollection_1 = new System.Collections.ObjectModel.ObservableCollection();
this.BParentCollection_2 = new System.Collections.ObjectModel.ObservableCollection();
-
Init();
}
@@ -112,7 +113,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
diff --git a/src/Testing/EF6/EF6NetCore3/Generated/Entities/BParentCollection.generated.cs b/src/Testing/EF6/EF6NetCore3/Generated/Entities/BParentCollection.generated.cs
index 0e6e96396..0e2e2fd96 100644
--- a/src/Testing/EF6/EF6NetCore3/Generated/Entities/BParentCollection.generated.cs
+++ b/src/Testing/EF6/EF6NetCore3/Generated/Entities/BParentCollection.generated.cs
@@ -50,9 +50,9 @@ public BParentCollection(global::Testing.BChild bchildrequired)
{
if (bchildrequired == null) throw new ArgumentNullException(nameof(bchildrequired));
this.BChildRequired = bchildrequired;
+ bchildrequired.BParentCollection.Add(this);
this.BChildCollection = new System.Collections.ObjectModel.ObservableCollection();
-
Init();
}
@@ -95,7 +95,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
@@ -110,8 +110,19 @@ protected set
* Navigation properties
*************************************************************************/
+ ///
+ /// Backing field for BChildRequired
+ ///
protected global::Testing.BChild _bChildRequired;
+
+ ///
+ /// When provided in a partial class, allows value of BChildRequired to be changed before setting.
+ ///
partial void SetBChildRequired(global::Testing.BChild oldValue, ref global::Testing.BChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of BChildRequired to be changed before returning.
+ ///
partial void GetBChildRequired(ref global::Testing.BChild result);
///
@@ -136,7 +147,11 @@ protected set
}
}
+ ///
+ /// Backing field for BChildCollection
+ ///
protected ICollection _bChildCollection;
+
public virtual ICollection BChildCollection
{
get
@@ -149,8 +164,19 @@ private set
}
}
+ ///
+ /// Backing field for BChildOptional
+ ///
protected global::Testing.BChild _bChildOptional;
+
+ ///
+ /// When provided in a partial class, allows value of BChildOptional to be changed before setting.
+ ///
partial void SetBChildOptional(global::Testing.BChild oldValue, ref global::Testing.BChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of BChildOptional to be changed before returning.
+ ///
partial void GetBChildOptional(ref global::Testing.BChild result);
public virtual global::Testing.BChild BChildOptional
diff --git a/src/Testing/EF6/EF6NetCore3/Generated/Entities/BParentOptional.generated.cs b/src/Testing/EF6/EF6NetCore3/Generated/Entities/BParentOptional.generated.cs
index 806647949..98c7a0d86 100644
--- a/src/Testing/EF6/EF6NetCore3/Generated/Entities/BParentOptional.generated.cs
+++ b/src/Testing/EF6/EF6NetCore3/Generated/Entities/BParentOptional.generated.cs
@@ -50,9 +50,9 @@ public BParentOptional(global::Testing.BChild bchildrequired)
{
if (bchildrequired == null) throw new ArgumentNullException(nameof(bchildrequired));
this.BChildRequired = bchildrequired;
+ bchildrequired.BParentOptional = this;
this.BChildCollection = new System.Collections.ObjectModel.ObservableCollection();
-
Init();
}
@@ -95,7 +95,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
@@ -110,8 +110,19 @@ protected set
* Navigation properties
*************************************************************************/
+ ///
+ /// Backing field for BChildRequired
+ ///
protected global::Testing.BChild _bChildRequired;
+
+ ///
+ /// When provided in a partial class, allows value of BChildRequired to be changed before setting.
+ ///
partial void SetBChildRequired(global::Testing.BChild oldValue, ref global::Testing.BChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of BChildRequired to be changed before returning.
+ ///
partial void GetBChildRequired(ref global::Testing.BChild result);
///
@@ -136,7 +147,11 @@ protected set
}
}
+ ///
+ /// Backing field for BChildCollection
+ ///
protected ICollection _bChildCollection;
+
public virtual ICollection BChildCollection
{
get
@@ -149,8 +164,19 @@ private set
}
}
+ ///
+ /// Backing field for BChildOptional
+ ///
protected global::Testing.BChild _bChildOptional;
+
+ ///
+ /// When provided in a partial class, allows value of BChildOptional to be changed before setting.
+ ///
partial void SetBChildOptional(global::Testing.BChild oldValue, ref global::Testing.BChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of BChildOptional to be changed before returning.
+ ///
partial void GetBChildOptional(ref global::Testing.BChild result);
public virtual global::Testing.BChild BChildOptional
diff --git a/src/Testing/EF6/EF6NetCore3/Generated/Entities/BParentRequired.generated.cs b/src/Testing/EF6/EF6NetCore3/Generated/Entities/BParentRequired.generated.cs
index 12f9a0c02..82d865e46 100644
--- a/src/Testing/EF6/EF6NetCore3/Generated/Entities/BParentRequired.generated.cs
+++ b/src/Testing/EF6/EF6NetCore3/Generated/Entities/BParentRequired.generated.cs
@@ -64,7 +64,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
@@ -79,8 +79,19 @@ protected set
* Navigation properties
*************************************************************************/
+ ///
+ /// Backing field for BChildOptional
+ ///
protected global::Testing.BChild _bChildOptional;
+
+ ///
+ /// When provided in a partial class, allows value of BChildOptional to be changed before setting.
+ ///
partial void SetBChildOptional(global::Testing.BChild oldValue, ref global::Testing.BChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of BChildOptional to be changed before returning.
+ ///
partial void GetBChildOptional(ref global::Testing.BChild result);
public virtual global::Testing.BChild BChildOptional
@@ -102,8 +113,19 @@ protected set
}
}
+ ///
+ /// Backing field for BChildRequired
+ ///
protected global::Testing.BChild _bChildRequired;
+
+ ///
+ /// When provided in a partial class, allows value of BChildRequired to be changed before setting.
+ ///
partial void SetBChildRequired(global::Testing.BChild oldValue, ref global::Testing.BChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of BChildRequired to be changed before returning.
+ ///
partial void GetBChildRequired(ref global::Testing.BChild result);
///
@@ -128,7 +150,11 @@ protected set
}
}
+ ///
+ /// Backing field for BChildCollection
+ ///
protected ICollection _bChildCollection;
+
public virtual ICollection BChildCollection
{
get
diff --git a/src/Testing/EF6/EF6NetCore3/Generated/Entities/BaseClass.generated.cs b/src/Testing/EF6/EF6NetCore3/Generated/Entities/BaseClass.generated.cs
index d5d203554..4bc2c5c1c 100644
--- a/src/Testing/EF6/EF6NetCore3/Generated/Entities/BaseClass.generated.cs
+++ b/src/Testing/EF6/EF6NetCore3/Generated/Entities/BaseClass.generated.cs
@@ -48,7 +48,6 @@ public BaseClass(string property0)
if (string.IsNullOrEmpty(property0)) throw new ArgumentNullException(nameof(property0));
this.Property0 = property0;
-
Init();
}
diff --git a/src/Testing/EF6/EF6NetCore3/Generated/Entities/BaseClassWithRequiredProperties.generated.cs b/src/Testing/EF6/EF6NetCore3/Generated/Entities/BaseClassWithRequiredProperties.generated.cs
index ede9bbf22..1c3e5878d 100644
--- a/src/Testing/EF6/EF6NetCore3/Generated/Entities/BaseClassWithRequiredProperties.generated.cs
+++ b/src/Testing/EF6/EF6NetCore3/Generated/Entities/BaseClassWithRequiredProperties.generated.cs
@@ -48,7 +48,6 @@ public BaseClassWithRequiredProperties(string property0)
if (string.IsNullOrEmpty(property0)) throw new ArgumentNullException(nameof(property0));
this.Property0 = property0;
-
Init();
}
@@ -91,7 +90,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
diff --git a/src/Testing/EF6/EF6NetCore3/Generated/Entities/Child.generated.cs b/src/Testing/EF6/EF6NetCore3/Generated/Entities/Child.generated.cs
index 24c750b01..1895dd5c2 100644
--- a/src/Testing/EF6/EF6NetCore3/Generated/Entities/Child.generated.cs
+++ b/src/Testing/EF6/EF6NetCore3/Generated/Entities/Child.generated.cs
@@ -51,12 +51,12 @@ public Child(global::Testing.Child parent, global::Testing.Master _master0)
{
if (parent == null) throw new ArgumentNullException(nameof(parent));
this.Parent = parent;
+ parent.Children.Add(this);
if (_master0 == null) throw new ArgumentNullException(nameof(_master0));
_master0.Children.Add(this);
this.Children = new System.Collections.ObjectModel.ObservableCollection();
-
Init();
}
@@ -100,7 +100,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
@@ -115,7 +115,11 @@ protected set
* Navigation properties
*************************************************************************/
+ ///
+ /// Backing field for Children
+ ///
protected ICollection _children;
+
public virtual ICollection Children
{
get
diff --git a/src/Testing/EF6/EF6NetCore3/Generated/Entities/ConcreteDerivedClass.generated.cs b/src/Testing/EF6/EF6NetCore3/Generated/Entities/ConcreteDerivedClass.generated.cs
index d8e84122f..addea6f3b 100644
--- a/src/Testing/EF6/EF6NetCore3/Generated/Entities/ConcreteDerivedClass.generated.cs
+++ b/src/Testing/EF6/EF6NetCore3/Generated/Entities/ConcreteDerivedClass.generated.cs
@@ -48,7 +48,6 @@ public ConcreteDerivedClass(string property0)
if (string.IsNullOrEmpty(property0)) throw new ArgumentNullException(nameof(property0));
this.Property0 = property0;
-
Init();
}
diff --git a/src/Testing/EF6/EF6NetCore3/Generated/Entities/ConcreteDerivedClassWithRequiredProperties.generated.cs b/src/Testing/EF6/EF6NetCore3/Generated/Entities/ConcreteDerivedClassWithRequiredProperties.generated.cs
index e69317163..cccbada76 100644
--- a/src/Testing/EF6/EF6NetCore3/Generated/Entities/ConcreteDerivedClassWithRequiredProperties.generated.cs
+++ b/src/Testing/EF6/EF6NetCore3/Generated/Entities/ConcreteDerivedClassWithRequiredProperties.generated.cs
@@ -52,7 +52,6 @@ public ConcreteDerivedClassWithRequiredProperties(string property1, string prope
if (string.IsNullOrEmpty(property0)) throw new ArgumentNullException(nameof(property0));
this.Property0 = property0;
-
Init();
}
diff --git a/src/Testing/EF6/EF6NetCore3/Generated/Entities/DerivedClass.generated.cs b/src/Testing/EF6/EF6NetCore3/Generated/Entities/DerivedClass.generated.cs
index 26776231a..ab2b80bb1 100644
--- a/src/Testing/EF6/EF6NetCore3/Generated/Entities/DerivedClass.generated.cs
+++ b/src/Testing/EF6/EF6NetCore3/Generated/Entities/DerivedClass.generated.cs
@@ -48,7 +48,6 @@ public DerivedClass(string property0)
if (string.IsNullOrEmpty(property0)) throw new ArgumentNullException(nameof(property0));
this.Property0 = property0;
-
Init();
}
diff --git a/src/Testing/EF6/EF6NetCore3/Generated/Entities/HiddenEntity.generated.cs b/src/Testing/EF6/EF6NetCore3/Generated/Entities/HiddenEntity.generated.cs
index 0568e94fe..cde47273c 100644
--- a/src/Testing/EF6/EF6NetCore3/Generated/Entities/HiddenEntity.generated.cs
+++ b/src/Testing/EF6/EF6NetCore3/Generated/Entities/HiddenEntity.generated.cs
@@ -61,7 +61,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
diff --git a/src/Testing/EF6/EF6NetCore3/Generated/Entities/Master.generated.cs b/src/Testing/EF6/EF6NetCore3/Generated/Entities/Master.generated.cs
index 2ae49defd..cb4445aee 100644
--- a/src/Testing/EF6/EF6NetCore3/Generated/Entities/Master.generated.cs
+++ b/src/Testing/EF6/EF6NetCore3/Generated/Entities/Master.generated.cs
@@ -63,7 +63,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
@@ -78,7 +78,11 @@ protected set
* Navigation properties
*************************************************************************/
+ ///
+ /// Backing field for Children
+ ///
protected ICollection _children;
+
public virtual ICollection Children
{
get
diff --git a/src/Testing/EF6/EF6NetCore3/Generated/Entities/ParserTest.generated.cs b/src/Testing/EF6/EF6NetCore3/Generated/Entities/ParserTest.generated.cs
index 9538d5ba2..533ca94c7 100644
--- a/src/Testing/EF6/EF6NetCore3/Generated/Entities/ParserTest.generated.cs
+++ b/src/Testing/EF6/EF6NetCore3/Generated/Entities/ParserTest.generated.cs
@@ -47,7 +47,6 @@ public ParserTest(long foo)
{
this.foo = foo;
-
Init();
}
@@ -90,7 +89,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
diff --git a/src/Testing/EF6/EF6NetCore3/Generated/Entities/RenamedColumn.generated.cs b/src/Testing/EF6/EF6NetCore3/Generated/Entities/RenamedColumn.generated.cs
index d39ea6ec6..cbda1dac1 100644
--- a/src/Testing/EF6/EF6NetCore3/Generated/Entities/RenamedColumn.generated.cs
+++ b/src/Testing/EF6/EF6NetCore3/Generated/Entities/RenamedColumn.generated.cs
@@ -61,7 +61,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
diff --git a/src/Testing/EF6/EF6NetCore3/Generated/Entities/SpatialProperties.generated.cs b/src/Testing/EF6/EF6NetCore3/Generated/Entities/SpatialProperties.generated.cs
index 8923c5cbf..ed58c8353 100644
--- a/src/Testing/EF6/EF6NetCore3/Generated/Entities/SpatialProperties.generated.cs
+++ b/src/Testing/EF6/EF6NetCore3/Generated/Entities/SpatialProperties.generated.cs
@@ -104,7 +104,6 @@ public SpatialProperties(DbGeography attrgeography, DbGeography attrgeographycol
if (attrgeometrypoint == null) throw new ArgumentNullException(nameof(attrgeometrypoint));
this.AttrGeometryPoint = attrgeometrypoint;
-
Init();
}
@@ -161,7 +160,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
diff --git a/src/Testing/EF6/EF6NetCore3/Generated/Entities/UChild.generated.cs b/src/Testing/EF6/EF6NetCore3/Generated/Entities/UChild.generated.cs
index a98e0cce7..96dfabc60 100644
--- a/src/Testing/EF6/EF6NetCore3/Generated/Entities/UChild.generated.cs
+++ b/src/Testing/EF6/EF6NetCore3/Generated/Entities/UChild.generated.cs
@@ -58,7 +58,6 @@ public UChild(global::Testing.UParentRequired _uparentrequired1, global::Testing
if (_uparentrequired2 == null) throw new ArgumentNullException(nameof(_uparentrequired2));
_uparentrequired2.UChildOptional = this;
-
Init();
}
@@ -102,7 +101,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
diff --git a/src/Testing/EF6/EF6NetCore3/Generated/Entities/UParentCollection.generated.cs b/src/Testing/EF6/EF6NetCore3/Generated/Entities/UParentCollection.generated.cs
index 57e7d17e8..e1d459a94 100644
--- a/src/Testing/EF6/EF6NetCore3/Generated/Entities/UParentCollection.generated.cs
+++ b/src/Testing/EF6/EF6NetCore3/Generated/Entities/UParentCollection.generated.cs
@@ -52,7 +52,6 @@ public UParentCollection(global::Testing.UChild uchildrequired)
this.UChildRequired = uchildrequired;
this.UChildCollection = new System.Collections.ObjectModel.ObservableCollection();
-
Init();
}
@@ -95,7 +94,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
@@ -110,8 +109,19 @@ protected set
* Navigation properties
*************************************************************************/
+ ///
+ /// Backing field for UChildRequired
+ ///
protected global::Testing.UChild _uChildRequired;
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before setting.
+ ///
partial void SetUChildRequired(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before returning.
+ ///
partial void GetUChildRequired(ref global::Testing.UChild result);
///
@@ -136,7 +146,11 @@ protected set
}
}
+ ///
+ /// Backing field for UChildCollection
+ ///
protected ICollection _uChildCollection;
+
public virtual ICollection UChildCollection
{
get
@@ -149,8 +163,19 @@ private set
}
}
+ ///
+ /// Backing field for UChildOptional
+ ///
protected global::Testing.UChild _uChildOptional;
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before setting.
+ ///
partial void SetUChildOptional(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before returning.
+ ///
partial void GetUChildOptional(ref global::Testing.UChild result);
public virtual global::Testing.UChild UChildOptional
diff --git a/src/Testing/EF6/EF6NetCore3/Generated/Entities/UParentOptional.generated.cs b/src/Testing/EF6/EF6NetCore3/Generated/Entities/UParentOptional.generated.cs
index cdc50803b..9132853fb 100644
--- a/src/Testing/EF6/EF6NetCore3/Generated/Entities/UParentOptional.generated.cs
+++ b/src/Testing/EF6/EF6NetCore3/Generated/Entities/UParentOptional.generated.cs
@@ -22,7 +22,8 @@ namespace Testing
///
/// x
///
- public partial class UParentOptional: global::Testing.HiddenEntity, INotifyPropertyChanged
+ [System.ComponentModel.Description("x")]
+ public partial class UParentOptional: global::Testing.HiddenEntity
{
partial void Init();
@@ -57,7 +58,6 @@ public UParentOptional(global::Testing.UChild uchildrequired)
this.UChildRequired = uchildrequired;
this.UChildCollection = new System.Collections.ObjectModel.ObservableCollection();
-
Init();
}
@@ -113,13 +113,25 @@ public string PropertyInChild
* Navigation properties
*************************************************************************/
+ ///
+ /// Backing field for UChildOptional
+ ///
protected global::Testing.UChild _uChildOptional;
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before setting.
+ ///
partial void SetUChildOptional(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before returning.
+ ///
partial void GetUChildOptional(ref global::Testing.UChild result);
///
/// x
///
+ [Description("x")]
public virtual global::Testing.UChild UChildOptional
{
get
@@ -139,10 +151,15 @@ public string PropertyInChild
}
}
+ ///
+ /// Backing field for UChildCollection
+ ///
protected ICollection _uChildCollection;
+
///
/// h
///
+ [Description("h")]
public virtual ICollection UChildCollection
{
get
@@ -155,8 +172,19 @@ private set
}
}
+ ///
+ /// Backing field for UChildRequired
+ ///
protected global::Testing.UChild _uChildRequired;
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before setting.
+ ///
partial void SetUChildRequired(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before returning.
+ ///
partial void GetUChildRequired(ref global::Testing.UChild result);
///
@@ -181,13 +209,6 @@ private set
}
}
- public virtual event PropertyChangedEventHandler PropertyChanged;
-
- protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
- }
-
}
}
diff --git a/src/Testing/EF6/EF6NetCore3/Generated/Entities/UParentRequired.generated.cs b/src/Testing/EF6/EF6NetCore3/Generated/Entities/UParentRequired.generated.cs
index 304681e19..49aace31d 100644
--- a/src/Testing/EF6/EF6NetCore3/Generated/Entities/UParentRequired.generated.cs
+++ b/src/Testing/EF6/EF6NetCore3/Generated/Entities/UParentRequired.generated.cs
@@ -64,7 +64,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
@@ -79,8 +79,19 @@ protected set
* Navigation properties
*************************************************************************/
+ ///
+ /// Backing field for UChildRequired
+ ///
protected global::Testing.UChild _uChildRequired;
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before setting.
+ ///
partial void SetUChildRequired(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before returning.
+ ///
partial void GetUChildRequired(ref global::Testing.UChild result);
///
@@ -105,7 +116,11 @@ protected set
}
}
+ ///
+ /// Backing field for UChildCollection
+ ///
protected ICollection _uChildCollection;
+
public virtual ICollection UChildCollection
{
get
@@ -118,8 +133,19 @@ private set
}
}
+ ///
+ /// Backing field for UChildOptional
+ ///
protected global::Testing.UChild _uChildOptional;
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before setting.
+ ///
partial void SetUChildOptional(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before returning.
+ ///
partial void GetUChildOptional(ref global::Testing.UChild result);
public virtual global::Testing.UChild UChildOptional
diff --git a/src/Testing/EF6/EF6NetFramework/AllFeatureModel.cs b/src/Testing/EF6/EF6NetFramework/AllFeatureModel.cs
index 6153a7d78..0182e3190 100644
--- a/src/Testing/EF6/EF6NetFramework/AllFeatureModel.cs
+++ b/src/Testing/EF6/EF6NetFramework/AllFeatureModel.cs
@@ -1 +1,1784 @@
+//------------------------------------------------------------------------------
+//
+// 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.
+//
+// Produced by Entity Framework Visual Editor v3.0.4.5
+// Source: https://github.com/msawczyn/EFDesigner
+// Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=michaelsawczyn.EFDesigner
+// Documentation: https://msawczyn.github.io/EFDesigner/
+// License (MIT): https://github.com/msawczyn/EFDesigner/blob/master/LICENSE
+//
+//------------------------------------------------------------------------------
+
+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;
+using System.Data.Entity.Spatial;
+
+namespace Testing
+{
+ public partial class AllPropertyTypesRequired
+ {
+ partial void Init();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected AllPropertyTypesRequired()
+ {
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static AllPropertyTypesRequired CreateAllPropertyTypesRequiredUnsafe()
+ {
+ return new AllPropertyTypesRequired();
+ }
+
+ ///
+ /// 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, TimeSpan timeattr, string stringattr)
+ {
+ this.BinaryAttr = binaryattr;
+
+ this.BooleanAttr = booleanattr;
+
+ this.ByteAttr = byteattr;
+
+ this.DateTimeAttr = datetimeattr;
+
+ this.DateTimeOffsetAttr = datetimeoffsetattr;
+
+ this.DecimalAttr = decimalattr;
+
+ this.DoubleAttr = doubleattr;
+
+ this.GuidAttr = guidattr;
+
+ this.Int16Attr = int16attr;
+
+ this.Int32Attr = int32attr;
+
+ this.Int64Attr = int64attr;
+
+ this.SingleAttr = singleattr;
+
+ this.TimeAttr = timeattr;
+
+ if (string.IsNullOrEmpty(stringattr)) throw new ArgumentNullException(nameof(stringattr));
+ this.StringAttr = stringattr;
+
+ 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, TimeSpan timeattr, string stringattr)
+ {
+ return new AllPropertyTypesRequired(binaryattr, booleanattr, byteattr, datetimeattr, datetimeoffsetattr, decimalattr, doubleattr, guidattr, int16attr, int32attr, int64attr, singleattr, timeattr, stringattr);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for Id
+ ///
+ protected int _id;
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ ///
+ partial void SetId(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ ///
+ partial void GetId(ref int result);
+
+ ///
+ /// Identity, Required
+ ///
+ [Key]
+ [Required]
+ public int Id
+ {
+ get
+ {
+ int value = _id;
+ GetId(ref value);
+ return (_id = value);
+ }
+ set
+ {
+ int oldValue = _id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _id = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for BinaryAttr
+ ///
+ protected byte[] _binaryAttr;
+ ///
+ /// When provided in a partial class, allows value of BinaryAttr to be changed before setting.
+ ///
+ partial void SetBinaryAttr(byte[] oldValue, ref byte[] newValue);
+ ///
+ /// When provided in a partial class, allows value of BinaryAttr to be changed before returning.
+ ///
+ partial void GetBinaryAttr(ref byte[] result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public byte[] BinaryAttr
+ {
+ get
+ {
+ byte[] value = _binaryAttr;
+ GetBinaryAttr(ref value);
+ return (_binaryAttr = value);
+ }
+ set
+ {
+ byte[] oldValue = _binaryAttr;
+ SetBinaryAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _binaryAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for BooleanAttr
+ ///
+ protected bool _booleanAttr;
+ ///
+ /// When provided in a partial class, allows value of BooleanAttr to be changed before setting.
+ ///
+ partial void SetBooleanAttr(bool oldValue, ref bool newValue);
+ ///
+ /// When provided in a partial class, allows value of BooleanAttr to be changed before returning.
+ ///
+ partial void GetBooleanAttr(ref bool result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public bool BooleanAttr
+ {
+ get
+ {
+ bool value = _booleanAttr;
+ GetBooleanAttr(ref value);
+ return (_booleanAttr = value);
+ }
+ set
+ {
+ bool oldValue = _booleanAttr;
+ SetBooleanAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _booleanAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for ByteAttr
+ ///
+ protected byte _byteAttr;
+ ///
+ /// When provided in a partial class, allows value of ByteAttr to be changed before setting.
+ ///
+ partial void SetByteAttr(byte oldValue, ref byte newValue);
+ ///
+ /// When provided in a partial class, allows value of ByteAttr to be changed before returning.
+ ///
+ partial void GetByteAttr(ref byte result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public byte ByteAttr
+ {
+ get
+ {
+ byte value = _byteAttr;
+ GetByteAttr(ref value);
+ return (_byteAttr = value);
+ }
+ set
+ {
+ byte oldValue = _byteAttr;
+ SetByteAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _byteAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for DateTimeAttr
+ ///
+ protected DateTime _dateTimeAttr;
+ ///
+ /// When provided in a partial class, allows value of DateTimeAttr to be changed before setting.
+ ///
+ partial void SetDateTimeAttr(DateTime oldValue, ref DateTime newValue);
+ ///
+ /// When provided in a partial class, allows value of DateTimeAttr to be changed before returning.
+ ///
+ partial void GetDateTimeAttr(ref DateTime result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public DateTime DateTimeAttr
+ {
+ get
+ {
+ DateTime value = _dateTimeAttr;
+ GetDateTimeAttr(ref value);
+ return (_dateTimeAttr = value);
+ }
+ set
+ {
+ DateTime oldValue = _dateTimeAttr;
+ SetDateTimeAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _dateTimeAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for DateTimeOffsetAttr
+ ///
+ protected DateTimeOffset _dateTimeOffsetAttr;
+ ///
+ /// When provided in a partial class, allows value of DateTimeOffsetAttr to be changed before setting.
+ ///
+ partial void SetDateTimeOffsetAttr(DateTimeOffset oldValue, ref DateTimeOffset newValue);
+ ///
+ /// When provided in a partial class, allows value of DateTimeOffsetAttr to be changed before returning.
+ ///
+ partial void GetDateTimeOffsetAttr(ref DateTimeOffset result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public DateTimeOffset DateTimeOffsetAttr
+ {
+ get
+ {
+ DateTimeOffset value = _dateTimeOffsetAttr;
+ GetDateTimeOffsetAttr(ref value);
+ return (_dateTimeOffsetAttr = value);
+ }
+ set
+ {
+ DateTimeOffset oldValue = _dateTimeOffsetAttr;
+ SetDateTimeOffsetAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _dateTimeOffsetAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for DecimalAttr
+ ///
+ protected decimal _decimalAttr;
+ ///
+ /// When provided in a partial class, allows value of DecimalAttr to be changed before setting.
+ ///
+ partial void SetDecimalAttr(decimal oldValue, ref decimal newValue);
+ ///
+ /// When provided in a partial class, allows value of DecimalAttr to be changed before returning.
+ ///
+ partial void GetDecimalAttr(ref decimal result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public decimal DecimalAttr
+ {
+ get
+ {
+ decimal value = _decimalAttr;
+ GetDecimalAttr(ref value);
+ return (_decimalAttr = value);
+ }
+ set
+ {
+ decimal oldValue = _decimalAttr;
+ SetDecimalAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _decimalAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for DoubleAttr
+ ///
+ protected double _doubleAttr;
+ ///
+ /// When provided in a partial class, allows value of DoubleAttr to be changed before setting.
+ ///
+ partial void SetDoubleAttr(double oldValue, ref double newValue);
+ ///
+ /// When provided in a partial class, allows value of DoubleAttr to be changed before returning.
+ ///
+ partial void GetDoubleAttr(ref double result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public double DoubleAttr
+ {
+ get
+ {
+ double value = _doubleAttr;
+ GetDoubleAttr(ref value);
+ return (_doubleAttr = value);
+ }
+ set
+ {
+ double oldValue = _doubleAttr;
+ SetDoubleAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _doubleAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for GuidAttr
+ ///
+ protected Guid _guidAttr;
+ ///
+ /// When provided in a partial class, allows value of GuidAttr to be changed before setting.
+ ///
+ partial void SetGuidAttr(Guid oldValue, ref Guid newValue);
+ ///
+ /// When provided in a partial class, allows value of GuidAttr to be changed before returning.
+ ///
+ partial void GetGuidAttr(ref Guid result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public Guid GuidAttr
+ {
+ get
+ {
+ Guid value = _guidAttr;
+ GetGuidAttr(ref value);
+ return (_guidAttr = value);
+ }
+ set
+ {
+ Guid oldValue = _guidAttr;
+ SetGuidAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _guidAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for Int16Attr
+ ///
+ protected short _int16Attr;
+ ///
+ /// When provided in a partial class, allows value of Int16Attr to be changed before setting.
+ ///
+ partial void SetInt16Attr(short oldValue, ref short newValue);
+ ///
+ /// When provided in a partial class, allows value of Int16Attr to be changed before returning.
+ ///
+ partial void GetInt16Attr(ref short result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public short Int16Attr
+ {
+ get
+ {
+ short value = _int16Attr;
+ GetInt16Attr(ref value);
+ return (_int16Attr = value);
+ }
+ set
+ {
+ short oldValue = _int16Attr;
+ SetInt16Attr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _int16Attr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for Int32Attr
+ ///
+ protected int _int32Attr;
+ ///
+ /// When provided in a partial class, allows value of Int32Attr to be changed before setting.
+ ///
+ partial void SetInt32Attr(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Int32Attr to be changed before returning.
+ ///
+ partial void GetInt32Attr(ref int result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public int Int32Attr
+ {
+ get
+ {
+ int value = _int32Attr;
+ GetInt32Attr(ref value);
+ return (_int32Attr = value);
+ }
+ set
+ {
+ int oldValue = _int32Attr;
+ SetInt32Attr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _int32Attr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for Int64Attr
+ ///
+ protected long _int64Attr;
+ ///
+ /// When provided in a partial class, allows value of Int64Attr to be changed before setting.
+ ///
+ partial void SetInt64Attr(long oldValue, ref long newValue);
+ ///
+ /// When provided in a partial class, allows value of Int64Attr to be changed before returning.
+ ///
+ partial void GetInt64Attr(ref long result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public long Int64Attr
+ {
+ get
+ {
+ long value = _int64Attr;
+ GetInt64Attr(ref value);
+ return (_int64Attr = value);
+ }
+ set
+ {
+ long oldValue = _int64Attr;
+ SetInt64Attr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _int64Attr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for SingleAttr
+ ///
+ protected Single _singleAttr;
+ ///
+ /// When provided in a partial class, allows value of SingleAttr to be changed before setting.
+ ///
+ partial void SetSingleAttr(Single oldValue, ref Single newValue);
+ ///
+ /// When provided in a partial class, allows value of SingleAttr to be changed before returning.
+ ///
+ partial void GetSingleAttr(ref Single result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public Single SingleAttr
+ {
+ get
+ {
+ Single value = _singleAttr;
+ GetSingleAttr(ref value);
+ return (_singleAttr = value);
+ }
+ set
+ {
+ Single oldValue = _singleAttr;
+ SetSingleAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _singleAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for TimeAttr
+ ///
+ protected TimeSpan _timeAttr;
+ ///
+ /// When provided in a partial class, allows value of TimeAttr to be changed before setting.
+ ///
+ partial void SetTimeAttr(TimeSpan oldValue, ref TimeSpan newValue);
+ ///
+ /// When provided in a partial class, allows value of TimeAttr to be changed before returning.
+ ///
+ partial void GetTimeAttr(ref TimeSpan result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public TimeSpan TimeAttr
+ {
+ get
+ {
+ TimeSpan value = _timeAttr;
+ GetTimeAttr(ref value);
+ return (_timeAttr = value);
+ }
+ set
+ {
+ TimeSpan oldValue = _timeAttr;
+ SetTimeAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _timeAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for StringAttr
+ ///
+ protected string _stringAttr;
+ ///
+ /// When provided in a partial class, allows value of StringAttr to be changed before setting.
+ ///
+ partial void SetStringAttr(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of StringAttr to be changed before returning.
+ ///
+ partial void GetStringAttr(ref string result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public string StringAttr
+ {
+ get
+ {
+ string value = _stringAttr;
+ GetStringAttr(ref value);
+ return (_stringAttr = value);
+ }
+ set
+ {
+ string oldValue = _stringAttr;
+ SetStringAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _stringAttr = value;
+ }
+ }
+ }
+
+ }
+}
+
+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;
+using System.Data.Entity.Spatial;
+
+namespace Testing
+{
+ public partial class AllPropertyTypesOptional
+ {
+ partial void Init();
+
+ ///
+ /// Default constructor
+ ///
+ public AllPropertyTypesOptional()
+ {
+ Init();
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for Id
+ ///
+ protected int _id;
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ ///
+ partial void SetId(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ ///
+ partial void GetId(ref int result);
+
+ ///
+ /// Identity, Required
+ ///
+ [Key]
+ [Required]
+ public int Id
+ {
+ get
+ {
+ int value = _id;
+ GetId(ref value);
+ return (_id = value);
+ }
+ set
+ {
+ int oldValue = _id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _id = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for BinaryAttr
+ ///
+ protected byte[] _binaryAttr;
+ ///
+ /// When provided in a partial class, allows value of BinaryAttr to be changed before setting.
+ ///
+ partial void SetBinaryAttr(byte[] oldValue, ref byte[] newValue);
+ ///
+ /// When provided in a partial class, allows value of BinaryAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _binaryAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for BooleanAttr
+ ///
+ protected bool? _booleanAttr;
+ ///
+ /// When provided in a partial class, allows value of BooleanAttr to be changed before setting.
+ ///
+ partial void SetBooleanAttr(bool? oldValue, ref bool? newValue);
+ ///
+ /// When provided in a partial class, allows value of BooleanAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _booleanAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for ByteAttr
+ ///
+ protected byte? _byteAttr;
+ ///
+ /// When provided in a partial class, allows value of ByteAttr to be changed before setting.
+ ///
+ partial void SetByteAttr(byte? oldValue, ref byte? newValue);
+ ///
+ /// When provided in a partial class, allows value of ByteAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _byteAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for DateTimeAttr
+ ///
+ protected DateTime? _dateTimeAttr;
+ ///
+ /// When provided in a partial class, allows value of DateTimeAttr to be changed before setting.
+ ///
+ partial void SetDateTimeAttr(DateTime? oldValue, ref DateTime? newValue);
+ ///
+ /// When provided in a partial class, allows value of DateTimeAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _dateTimeAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for DateTimeOffsetAttr
+ ///
+ protected DateTimeOffset? _dateTimeOffsetAttr;
+ ///
+ /// When provided in a partial class, allows value of DateTimeOffsetAttr to be changed before setting.
+ ///
+ partial void SetDateTimeOffsetAttr(DateTimeOffset? oldValue, ref DateTimeOffset? newValue);
+ ///
+ /// When provided in a partial class, allows value of DateTimeOffsetAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _dateTimeOffsetAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for DecimalAttr
+ ///
+ protected decimal? _decimalAttr;
+ ///
+ /// When provided in a partial class, allows value of DecimalAttr to be changed before setting.
+ ///
+ partial void SetDecimalAttr(decimal? oldValue, ref decimal? newValue);
+ ///
+ /// When provided in a partial class, allows value of DecimalAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _decimalAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for DoubleAttr
+ ///
+ protected double? _doubleAttr;
+ ///
+ /// When provided in a partial class, allows value of DoubleAttr to be changed before setting.
+ ///
+ partial void SetDoubleAttr(double? oldValue, ref double? newValue);
+ ///
+ /// When provided in a partial class, allows value of DoubleAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _doubleAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for GuidAttr
+ ///
+ protected Guid? _guidAttr;
+ ///
+ /// When provided in a partial class, allows value of GuidAttr to be changed before setting.
+ ///
+ partial void SetGuidAttr(Guid? oldValue, ref Guid? newValue);
+ ///
+ /// When provided in a partial class, allows value of GuidAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _guidAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for Int16Attr
+ ///
+ protected short? _int16Attr;
+ ///
+ /// When provided in a partial class, allows value of Int16Attr to be changed before setting.
+ ///
+ partial void SetInt16Attr(short? oldValue, ref short? newValue);
+ ///
+ /// When provided in a partial class, allows value of Int16Attr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _int16Attr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for Int32Attr
+ ///
+ protected int? _int32Attr;
+ ///
+ /// When provided in a partial class, allows value of Int32Attr to be changed before setting.
+ ///
+ partial void SetInt32Attr(int? oldValue, ref int? newValue);
+ ///
+ /// When provided in a partial class, allows value of Int32Attr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _int32Attr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for Int64Attr
+ ///
+ protected long? _int64Attr;
+ ///
+ /// When provided in a partial class, allows value of Int64Attr to be changed before setting.
+ ///
+ partial void SetInt64Attr(long? oldValue, ref long? newValue);
+ ///
+ /// When provided in a partial class, allows value of Int64Attr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _int64Attr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for SingleAttr
+ ///
+ protected Single? _singleAttr;
+ ///
+ /// When provided in a partial class, allows value of SingleAttr to be changed before setting.
+ ///
+ partial void SetSingleAttr(Single? oldValue, ref Single? newValue);
+ ///
+ /// When provided in a partial class, allows value of SingleAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _singleAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for TimeAttr
+ ///
+ protected TimeSpan? _timeAttr;
+ ///
+ /// When provided in a partial class, allows value of TimeAttr to be changed before setting.
+ ///
+ partial void SetTimeAttr(TimeSpan? oldValue, ref TimeSpan? newValue);
+ ///
+ /// When provided in a partial class, allows value of TimeAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _timeAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for StringAttr
+ ///
+ protected string _stringAttr;
+ ///
+ /// When provided in a partial class, allows value of StringAttr to be changed before setting.
+ ///
+ partial void SetStringAttr(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of StringAttr to be changed before returning.
+ ///
+ partial void GetStringAttr(ref string result);
+
+ public string StringAttr
+ {
+ get
+ {
+ string value = _stringAttr;
+ GetStringAttr(ref value);
+ return (_stringAttr = value);
+ }
+ set
+ {
+ string oldValue = _stringAttr;
+ SetStringAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _stringAttr = value;
+ }
+ }
+ }
+
+ }
+}
+
+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;
+using System.Data.Entity.Spatial;
+
+namespace Testing
+{
+ public partial class UParentRequired
+ {
+ partial void Init();
+
+ ///
+ /// Default constructor
+ ///
+ public UParentRequired()
+ {
+ UChildCollection = new System.Collections.ObjectModel.ObservableCollection();
+ UChildRequired = global::Testing.UChild.CreateUChildUnsafe();
+
+ Init();
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for Id
+ ///
+ internal int _id;
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ ///
+ partial void SetId(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ ///
+ partial void GetId(ref int result);
+
+ ///
+ /// Identity, Indexed, Required
+ ///
+ [Key]
+ [Required]
+ public int Id
+ {
+ get
+ {
+ int value = _id;
+ GetId(ref value);
+ return (_id = value);
+ }
+ set
+ {
+ int oldValue = _id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _id = value;
+ }
+ }
+ }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for UChildRequired
+ ///
+ protected global::Testing.UChild _uChildRequired;
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before setting.
+ ///
+ partial void SetUChildRequired(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before returning.
+ ///
+ partial void GetUChildRequired(ref global::Testing.UChild result);
+
+ ///
+ /// Required
+ ///
+ public virtual global::Testing.UChild UChildRequired
+ {
+ get
+ {
+ global::Testing.UChild value = _uChildRequired;
+ GetUChildRequired(ref value);
+ return (_uChildRequired = value);
+ }
+ set
+ {
+ global::Testing.UChild oldValue = _uChildRequired;
+ SetUChildRequired(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _uChildRequired = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for UChildCollection
+ ///
+ protected ICollection _uChildCollection;
+
+ public virtual ICollection UChildCollection
+ {
+ get
+ {
+ return _uChildCollection;
+ }
+ private set
+ {
+ _uChildCollection = value;
+ }
+ }
+
+ ///
+ /// Backing field for UChildOptional
+ ///
+ protected global::Testing.UChild _uChildOptional;
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before setting.
+ ///
+ partial void SetUChildOptional(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before returning.
+ ///
+ partial void GetUChildOptional(ref global::Testing.UChild result);
+
+ public virtual global::Testing.UChild UChildOptional
+ {
+ get
+ {
+ global::Testing.UChild value = _uChildOptional;
+ GetUChildOptional(ref value);
+ return (_uChildOptional = value);
+ }
+ set
+ {
+ global::Testing.UChild oldValue = _uChildOptional;
+ SetUChildOptional(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _uChildOptional = value;
+ }
+ }
+ }
+
+ }
+}
+
+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;
+using System.Data.Entity.Spatial;
+
+namespace Testing
+{
+ ///
+ /// x
+ ///
+ [System.ComponentModel.Description("x")]
+ public partial class UParentOptional: global::Testing.HiddenEntity
+ {
+ 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.ObjectModel.ObservableCollection();
+ UChildRequired = global::Testing.UChild.CreateUChildUnsafe();
+
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static UParentOptional CreateUParentOptionalUnsafe()
+ {
+ return new UParentOptional();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
+ ///
+ public UParentOptional(global::Testing.UChild uchildrequired)
+ {
+ this.PropertyInChild = "hello";
+ if (uchildrequired == null) throw new ArgumentNullException(nameof(uchildrequired));
+ this.UChildRequired = uchildrequired;
+
+ this.UChildCollection = new System.Collections.ObjectModel.ObservableCollection();
+ Init();
+ }
+
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ ///
+ public static UParentOptional Create(global::Testing.UChild uchildrequired)
+ {
+ return new UParentOptional(uchildrequired);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for PropertyInChild
+ ///
+ protected string _propertyInChild;
+ ///
+ /// When provided in a partial class, allows value of PropertyInChild to be changed before setting.
+ ///
+ partial void SetPropertyInChild(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of PropertyInChild to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _propertyInChild = value;
+ }
+ }
+ }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for UChildOptional
+ ///
+ protected global::Testing.UChild _uChildOptional;
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before setting.
+ ///
+ partial void SetUChildOptional(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before returning.
+ ///
+ partial void GetUChildOptional(ref global::Testing.UChild result);
+
+ ///
+ /// x
+ ///
+ [Description("x")]
+ public virtual global::Testing.UChild UChildOptional
+ {
+ get
+ {
+ global::Testing.UChild value = _uChildOptional;
+ GetUChildOptional(ref value);
+ return (_uChildOptional = value);
+ }
+ set
+ {
+ global::Testing.UChild oldValue = _uChildOptional;
+ SetUChildOptional(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _uChildOptional = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for UChildCollection
+ ///
+ protected ICollection _uChildCollection;
+
+ ///
+ /// h
+ ///
+ [Description("h")]
+ public virtual ICollection UChildCollection
+ {
+ get
+ {
+ return _uChildCollection;
+ }
+ private set
+ {
+ _uChildCollection = value;
+ }
+ }
+
+ ///
+ /// Backing field for UChildRequired
+ ///
+ protected global::Testing.UChild _uChildRequired;
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before setting.
+ ///
+ partial void SetUChildRequired(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before returning.
+ ///
+ partial void GetUChildRequired(ref global::Testing.UChild result);
+
+ ///
+ /// Required
+ ///
+ public virtual global::Testing.UChild UChildRequired
+ {
+ get
+ {
+ global::Testing.UChild value = _uChildRequired;
+ GetUChildRequired(ref value);
+ return (_uChildRequired = value);
+ }
+ set
+ {
+ global::Testing.UChild oldValue = _uChildRequired;
+ SetUChildRequired(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _uChildRequired = value;
+ }
+ }
+ }
+
+ }
+}
+
+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;
+using System.Data.Entity.Spatial;
+
+namespace Testing
+{
+ public partial class UParentCollection
+ {
+ partial void Init();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected UParentCollection()
+ {
+ UChildCollection = new System.Collections.ObjectModel.ObservableCollection();
+ UChildRequired = global::Testing.UChild.CreateUChildUnsafe();
+
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static UParentCollection CreateUParentCollectionUnsafe()
+ {
+ return new UParentCollection();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
+ ///
+ public UParentCollection(global::Testing.UChild uchildrequired)
+ {
+ if (uchildrequired == null) throw new ArgumentNullException(nameof(uchildrequired));
+ this.UChildRequired = uchildrequired;
+
+ this.UChildCollection = new System.Collections.ObjectModel.ObservableCollection();
+ Init();
+ }
+
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ ///
+ public static UParentCollection Create(global::Testing.UChild uchildrequired)
+ {
+ return new UParentCollection(uchildrequired);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for Id
+ ///
+ internal int _id;
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ ///
+ partial void SetId(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ ///
+ partial void GetId(ref int result);
+
+ ///
+ /// Identity, Indexed, Required
+ ///
+ [Key]
+ [Required]
+ public int Id
+ {
+ get
+ {
+ int value = _id;
+ GetId(ref value);
+ return (_id = value);
+ }
+ set
+ {
+ int oldValue = _id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _id = value;
+ }
+ }
+ }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for UChildRequired
+ ///
+ protected global::Testing.UChild _uChildRequired;
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before setting.
+ ///
+ partial void SetUChildRequired(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before returning.
+ ///
+ partial void GetUChildRequired(ref global::Testing.UChild result);
+
+ ///
+ /// Required
+ ///
+ public virtual global::Testing.UChild UChildRequired
+ {
+ get
+ {
+ global::Testing.UChild value = _uChildRequired;
+ GetUChildRequired(ref value);
+ return (_uChildRequired = value);
+ }
+ set
+ {
+ global::Testing.UChild oldValue = _uChildRequired;
+ SetUChildRequired(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _uChildRequired = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for UChildCollection
+ ///
+ protected ICollection _uChildCollection;
+
+ public virtual ICollection UChildCollection
+ {
+ get
+ {
+ return _uChildCollection;
+ }
+ private set
+ {
+ _uChildCollection = value;
+ }
+ }
+
+ ///
+ /// Backing field for UChildOptional
+ ///
+ protected global::Testing.UChild _uChildOptional;
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before setting.
+ ///
+ partial void SetUChildOptional(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before returning.
+ ///
+ partial void GetUChildOptional(ref global::Testing.UChild result);
+
+ public virtual global::Testing.UChild UChildOptional
+ {
+ get
+ {
+ global::Testing.UChild value = _uChildOptional;
+ GetUChildOptional(ref value);
+ return (_uChildOptional = value);
+ }
+ set
+ {
+ global::Testing.UChild oldValue = _uChildOptional;
+ SetUChildOptional(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _uChildOptional = value;
+ }
+ }
+ }
+
+ }
+}
+
+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;
+using System.Data.Entity.Spatial;
+
+namespace Testing
+{
+ public partial class UChild
+ {
+ partial void Init();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected UChild()
+ {
+ // NOTE: This class has one-to-one associations with UChild.
+ // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
+
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static UChild CreateUChildUnsafe()
+ {
+ return new UChild();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
diff --git a/src/Testing/EF6/EF6NetFramework/Generated/Context/AllFeatureModel.generated.cs b/src/Testing/EF6/EF6NetFramework/Generated/Context/AllFeatureModel.generated.cs
index 171076421..1a581f49a 100644
--- a/src/Testing/EF6/EF6NetFramework/Generated/Context/AllFeatureModel.generated.cs
+++ b/src/Testing/EF6/EF6NetFramework/Generated/Context/AllFeatureModel.generated.cs
@@ -5,7 +5,7 @@
// 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.
//
-// Produced by Entity Framework Visual Editor v3.0.0.5
+// Produced by Entity Framework Visual Editor v3.0.4.4
// Source: https://github.com/msawczyn/EFDesigner
// Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=michaelsawczyn.EFDesigner
// Documentation: https://msawczyn.github.io/EFDesigner/
@@ -138,7 +138,7 @@ protected override void OnModelCreating(System.Data.Entity.DbModelBuilder modelB
modelBuilder.HasDefaultSchema("dbo");
- modelBuilder.Entity().ToTable("AbstractBaseClasses").HasKey(t => t.Id);
+ modelBuilder.Entity().ToTable("AbstractBaseClasses");
modelBuilder.Entity().ToTable("AllPropertyTypesOptionals").HasKey(t => t.Id);
modelBuilder.Entity().Property(t => t.Id).IsRequired().HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
@@ -160,7 +160,7 @@ protected override void OnModelCreating(System.Data.Entity.DbModelBuilder modelB
modelBuilder.Entity().Property(t => t.TimeAttr).IsRequired();
modelBuilder.Entity().Property(t => t.StringAttr).IsRequired();
- modelBuilder.Entity().ToTable("BaseClasses").HasKey(t => t.Id);
+ modelBuilder.Entity().ToTable("BaseClasses");
modelBuilder.Entity().ToTable("BaseClassWithRequiredProperties").HasKey(t => t.Id);
modelBuilder.Entity().Property(t => t.Id).IsRequired().HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
@@ -191,12 +191,12 @@ protected override void OnModelCreating(System.Data.Entity.DbModelBuilder modelB
modelBuilder.Entity().Property(t => t.Id).IsRequired().HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
modelBuilder.Entity().HasRequired(x => x.Parent).WithMany(x => x.Children).Map(x => x.MapKey("ParentId"));
- modelBuilder.Entity().ToTable("ConcreteDerivedClasses").HasKey(t => t.Id);
+ modelBuilder.Entity().ToTable("ConcreteDerivedClasses");
- modelBuilder.Entity().ToTable("ConcreteDerivedClassWithRequiredProperties").HasKey(t => t.Id);
+ modelBuilder.Entity().ToTable("ConcreteDerivedClassWithRequiredProperties");
modelBuilder.Entity().Property(t => t.Property1).IsRequired();
- modelBuilder.Entity().ToTable("DerivedClasses").HasKey(t => new { t.Id1, t.Id });
+ modelBuilder.Entity().ToTable("DerivedClasses").HasKey(t => t.Id1);
modelBuilder.Entity().Property(t => t.Id1).IsRequired().HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
modelBuilder.Entity().ToTable("HiddenEntities").HasKey(t => t.Id);
@@ -204,7 +204,7 @@ protected override void OnModelCreating(System.Data.Entity.DbModelBuilder modelB
modelBuilder.Entity().ToTable("Masters").HasKey(t => t.Id);
modelBuilder.Entity().Property(t => t.Id).IsRequired().HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
- modelBuilder.Entity().HasMany(x => x.Children).WithRequired().Map(x => x.MapKey("Master_Children_Id"));
+ modelBuilder.Entity().HasMany(x => x.Children).WithRequired().Map(x => x.MapKey("MasterChildrenId"));
modelBuilder.Entity().ToTable("ParserTests").HasKey(t => t.Id);
modelBuilder.Entity().Property(t => t.Id).IsRequired().HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
@@ -225,15 +225,15 @@ protected override void OnModelCreating(System.Data.Entity.DbModelBuilder modelB
modelBuilder.Entity().HasMany(x => x.UChildCollection).WithMany().Map(x => { x.ToTable("UParentCollection_x_UChildCollection"); x.MapLeftKey("UParentCollection_Id"); x.MapRightKey("UChild_Id"); });
modelBuilder.Entity().HasOptional(x => x.UChildOptional).WithMany().Map(x => x.MapKey("UChildOptionalId"));
- modelBuilder.Entity().ToTable("UParentOptionals").HasKey(t => t.Id);
+ modelBuilder.Entity().ToTable("UParentOptionals");
modelBuilder.Entity().HasOptional(x => x.UChildOptional).WithOptionalDependent();
- modelBuilder.Entity().HasMany(x => x.UChildCollection).WithOptional().Map(x => x.MapKey("UParentOptional_UChildCollection_Id"));
+ modelBuilder.Entity().HasMany(x => x.UChildCollection).WithOptional().Map(x => x.MapKey("UParentOptionalUChildCollectionId"));
modelBuilder.Entity().HasRequired(x => x.UChildRequired).WithOptional();
modelBuilder.Entity().ToTable("UParentRequireds").HasKey(t => t.Id);
modelBuilder.Entity().Property(t => t.Id).IsRequired().HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
modelBuilder.Entity().HasRequired(x => x.UChildRequired).WithRequiredDependent();
- modelBuilder.Entity().HasMany(x => x.UChildCollection).WithRequired().Map(x => x.MapKey("UParentRequired_UChildCollection_Id"));
+ modelBuilder.Entity().HasMany(x => x.UChildCollection).WithRequired().Map(x => x.MapKey("UParentRequiredUChildCollectionId"));
modelBuilder.Entity().HasOptional(x => x.UChildOptional).WithRequired().WillCascadeOnDelete(true);
OnModelCreatedImpl(modelBuilder);
diff --git a/src/Testing/EF6/EF6NetFramework/Generated/Context/AllFeatureModelDbMigrationConfiguration.generated.cs b/src/Testing/EF6/EF6NetFramework/Generated/Context/AllFeatureModelDbMigrationConfiguration.generated.cs
index a798fd2b4..30077c571 100644
--- a/src/Testing/EF6/EF6NetFramework/Generated/Context/AllFeatureModelDbMigrationConfiguration.generated.cs
+++ b/src/Testing/EF6/EF6NetFramework/Generated/Context/AllFeatureModelDbMigrationConfiguration.generated.cs
@@ -5,7 +5,7 @@
// 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.
//
-// Produced by Entity Framework Visual Editor v3.0.0.5
+// Produced by Entity Framework Visual Editor v3.0.4.4
// Source: https://github.com/msawczyn/EFDesigner
// Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=michaelsawczyn.EFDesigner
// Documentation: https://msawczyn.github.io/EFDesigner/
diff --git a/src/Testing/EF6/EF6NetFramework/Generated/Entities/AbstractBaseClass.generated.cs b/src/Testing/EF6/EF6NetFramework/Generated/Entities/AbstractBaseClass.generated.cs
index 7633ded61..5690939f7 100644
--- a/src/Testing/EF6/EF6NetFramework/Generated/Entities/AbstractBaseClass.generated.cs
+++ b/src/Testing/EF6/EF6NetFramework/Generated/Entities/AbstractBaseClass.generated.cs
@@ -5,7 +5,7 @@
// 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.
//
-// Produced by Entity Framework Visual Editor v3.0.0.5
+// Produced by Entity Framework Visual Editor v3.0.4.4
// Source: https://github.com/msawczyn/EFDesigner
// Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=michaelsawczyn.EFDesigner
// Documentation: https://msawczyn.github.io/EFDesigner/
@@ -46,7 +46,6 @@ protected AbstractBaseClass(string property0)
if (string.IsNullOrEmpty(property0)) throw new ArgumentNullException(nameof(property0));
this.Property0 = property0;
-
Init();
}
diff --git a/src/Testing/EF6/EF6NetFramework/Generated/Entities/AllPropertyTypesOptional.generated.cs b/src/Testing/EF6/EF6NetFramework/Generated/Entities/AllPropertyTypesOptional.generated.cs
index 71ac437a6..d9cf76d80 100644
--- a/src/Testing/EF6/EF6NetFramework/Generated/Entities/AllPropertyTypesOptional.generated.cs
+++ b/src/Testing/EF6/EF6NetFramework/Generated/Entities/AllPropertyTypesOptional.generated.cs
@@ -5,7 +5,7 @@
// 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.
//
-// Produced by Entity Framework Visual Editor v3.0.0.5
+// Produced by Entity Framework Visual Editor v3.0.4.4
// Source: https://github.com/msawczyn/EFDesigner
// Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=michaelsawczyn.EFDesigner
// Documentation: https://msawczyn.github.io/EFDesigner/
@@ -67,7 +67,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
diff --git a/src/Testing/EF6/EF6NetFramework/Generated/Entities/AllPropertyTypesRequired.generated.cs b/src/Testing/EF6/EF6NetFramework/Generated/Entities/AllPropertyTypesRequired.generated.cs
index 721c9ca6b..94fc6ccb7 100644
--- a/src/Testing/EF6/EF6NetFramework/Generated/Entities/AllPropertyTypesRequired.generated.cs
+++ b/src/Testing/EF6/EF6NetFramework/Generated/Entities/AllPropertyTypesRequired.generated.cs
@@ -5,7 +5,7 @@
// 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.
//
-// Produced by Entity Framework Visual Editor v3.0.0.5
+// Produced by Entity Framework Visual Editor v3.0.4.4
// Source: https://github.com/msawczyn/EFDesigner
// Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=michaelsawczyn.EFDesigner
// Documentation: https://msawczyn.github.io/EFDesigner/
@@ -93,7 +93,6 @@ public AllPropertyTypesRequired(byte[] binaryattr, bool booleanattr, byte byteat
if (string.IsNullOrEmpty(stringattr)) throw new ArgumentNullException(nameof(stringattr));
this.StringAttr = stringattr;
-
Init();
}
@@ -149,7 +148,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
diff --git a/src/Testing/EF6/EF6NetFramework/Generated/Entities/BChild.generated.cs b/src/Testing/EF6/EF6NetFramework/Generated/Entities/BChild.generated.cs
index 0cecaa8dd..ece0e0875 100644
--- a/src/Testing/EF6/EF6NetFramework/Generated/Entities/BChild.generated.cs
+++ b/src/Testing/EF6/EF6NetFramework/Generated/Entities/BChild.generated.cs
@@ -5,7 +5,7 @@
// 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.
//
-// Produced by Entity Framework Visual Editor v3.0.0.5
+// Produced by Entity Framework Visual Editor v3.0.4.4
// Source: https://github.com/msawczyn/EFDesigner
// Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=michaelsawczyn.EFDesigner
// Documentation: https://msawczyn.github.io/EFDesigner/
@@ -67,14 +67,15 @@ public BChild(global::Testing.BParentRequired bparentrequired, global::Testing.B
if (bparentrequired == null) throw new ArgumentNullException(nameof(bparentrequired));
this.BParentRequired = bparentrequired;
+ bparentrequired.BChildOptional = this;
if (bparentrequired_2 == null) throw new ArgumentNullException(nameof(bparentrequired_2));
this.BParentRequired_2 = bparentrequired_2;
+ bparentrequired_2.BChildCollection.Add(this);
this.BParentCollection = new System.Collections.ObjectModel.ObservableCollection();
this.BParentCollection_1 = new System.Collections.ObjectModel.ObservableCollection();
this.BParentCollection_2 = new System.Collections.ObjectModel.ObservableCollection();
-
Init();
}
@@ -118,7 +119,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
diff --git a/src/Testing/EF6/EF6NetFramework/Generated/Entities/BParentCollection.generated.cs b/src/Testing/EF6/EF6NetFramework/Generated/Entities/BParentCollection.generated.cs
index 1de06fddd..895a7b8d4 100644
--- a/src/Testing/EF6/EF6NetFramework/Generated/Entities/BParentCollection.generated.cs
+++ b/src/Testing/EF6/EF6NetFramework/Generated/Entities/BParentCollection.generated.cs
@@ -5,7 +5,7 @@
// 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.
//
-// Produced by Entity Framework Visual Editor v3.0.0.5
+// Produced by Entity Framework Visual Editor v3.0.4.4
// Source: https://github.com/msawczyn/EFDesigner
// Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=michaelsawczyn.EFDesigner
// Documentation: https://msawczyn.github.io/EFDesigner/
@@ -56,9 +56,9 @@ public BParentCollection(global::Testing.BChild bchildrequired)
{
if (bchildrequired == null) throw new ArgumentNullException(nameof(bchildrequired));
this.BChildRequired = bchildrequired;
+ bchildrequired.BParentCollection.Add(this);
this.BChildCollection = new System.Collections.ObjectModel.ObservableCollection();
-
Init();
}
@@ -101,7 +101,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
@@ -116,8 +116,19 @@ protected set
* Navigation properties
*************************************************************************/
+ ///
+ /// Backing field for BChildRequired
+ ///
protected global::Testing.BChild _bChildRequired;
+
+ ///
+ /// When provided in a partial class, allows value of BChildRequired to be changed before setting.
+ ///
partial void SetBChildRequired(global::Testing.BChild oldValue, ref global::Testing.BChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of BChildRequired to be changed before returning.
+ ///
partial void GetBChildRequired(ref global::Testing.BChild result);
///
@@ -142,7 +153,11 @@ protected set
}
}
+ ///
+ /// Backing field for BChildCollection
+ ///
protected ICollection _bChildCollection;
+
public virtual ICollection BChildCollection
{
get
@@ -155,8 +170,19 @@ private set
}
}
+ ///
+ /// Backing field for BChildOptional
+ ///
protected global::Testing.BChild _bChildOptional;
+
+ ///
+ /// When provided in a partial class, allows value of BChildOptional to be changed before setting.
+ ///
partial void SetBChildOptional(global::Testing.BChild oldValue, ref global::Testing.BChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of BChildOptional to be changed before returning.
+ ///
partial void GetBChildOptional(ref global::Testing.BChild result);
public virtual global::Testing.BChild BChildOptional
diff --git a/src/Testing/EF6/EF6NetFramework/Generated/Entities/BParentOptional.generated.cs b/src/Testing/EF6/EF6NetFramework/Generated/Entities/BParentOptional.generated.cs
index e10337eb5..fefc0a9e6 100644
--- a/src/Testing/EF6/EF6NetFramework/Generated/Entities/BParentOptional.generated.cs
+++ b/src/Testing/EF6/EF6NetFramework/Generated/Entities/BParentOptional.generated.cs
@@ -5,7 +5,7 @@
// 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.
//
-// Produced by Entity Framework Visual Editor v3.0.0.5
+// Produced by Entity Framework Visual Editor v3.0.4.4
// Source: https://github.com/msawczyn/EFDesigner
// Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=michaelsawczyn.EFDesigner
// Documentation: https://msawczyn.github.io/EFDesigner/
@@ -56,9 +56,9 @@ public BParentOptional(global::Testing.BChild bchildrequired)
{
if (bchildrequired == null) throw new ArgumentNullException(nameof(bchildrequired));
this.BChildRequired = bchildrequired;
+ bchildrequired.BParentOptional = this;
this.BChildCollection = new System.Collections.ObjectModel.ObservableCollection();
-
Init();
}
@@ -101,7 +101,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
@@ -116,8 +116,19 @@ protected set
* Navigation properties
*************************************************************************/
+ ///
+ /// Backing field for BChildRequired
+ ///
protected global::Testing.BChild _bChildRequired;
+
+ ///
+ /// When provided in a partial class, allows value of BChildRequired to be changed before setting.
+ ///
partial void SetBChildRequired(global::Testing.BChild oldValue, ref global::Testing.BChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of BChildRequired to be changed before returning.
+ ///
partial void GetBChildRequired(ref global::Testing.BChild result);
///
@@ -142,7 +153,11 @@ protected set
}
}
+ ///
+ /// Backing field for BChildCollection
+ ///
protected ICollection _bChildCollection;
+
public virtual ICollection BChildCollection
{
get
@@ -155,8 +170,19 @@ private set
}
}
+ ///
+ /// Backing field for BChildOptional
+ ///
protected global::Testing.BChild _bChildOptional;
+
+ ///
+ /// When provided in a partial class, allows value of BChildOptional to be changed before setting.
+ ///
partial void SetBChildOptional(global::Testing.BChild oldValue, ref global::Testing.BChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of BChildOptional to be changed before returning.
+ ///
partial void GetBChildOptional(ref global::Testing.BChild result);
public virtual global::Testing.BChild BChildOptional
diff --git a/src/Testing/EF6/EF6NetFramework/Generated/Entities/BParentRequired.generated.cs b/src/Testing/EF6/EF6NetFramework/Generated/Entities/BParentRequired.generated.cs
index 9b31c394b..5739ceec7 100644
--- a/src/Testing/EF6/EF6NetFramework/Generated/Entities/BParentRequired.generated.cs
+++ b/src/Testing/EF6/EF6NetFramework/Generated/Entities/BParentRequired.generated.cs
@@ -5,7 +5,7 @@
// 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.
//
-// Produced by Entity Framework Visual Editor v3.0.0.5
+// Produced by Entity Framework Visual Editor v3.0.4.4
// Source: https://github.com/msawczyn/EFDesigner
// Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=michaelsawczyn.EFDesigner
// Documentation: https://msawczyn.github.io/EFDesigner/
@@ -70,7 +70,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
@@ -85,8 +85,19 @@ protected set
* Navigation properties
*************************************************************************/
+ ///
+ /// Backing field for BChildOptional
+ ///
protected global::Testing.BChild _bChildOptional;
+
+ ///
+ /// When provided in a partial class, allows value of BChildOptional to be changed before setting.
+ ///
partial void SetBChildOptional(global::Testing.BChild oldValue, ref global::Testing.BChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of BChildOptional to be changed before returning.
+ ///
partial void GetBChildOptional(ref global::Testing.BChild result);
public virtual global::Testing.BChild BChildOptional
@@ -108,8 +119,19 @@ protected set
}
}
+ ///
+ /// Backing field for BChildRequired
+ ///
protected global::Testing.BChild _bChildRequired;
+
+ ///
+ /// When provided in a partial class, allows value of BChildRequired to be changed before setting.
+ ///
partial void SetBChildRequired(global::Testing.BChild oldValue, ref global::Testing.BChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of BChildRequired to be changed before returning.
+ ///
partial void GetBChildRequired(ref global::Testing.BChild result);
///
@@ -134,7 +156,11 @@ protected set
}
}
+ ///
+ /// Backing field for BChildCollection
+ ///
protected ICollection _bChildCollection;
+
public virtual ICollection BChildCollection
{
get
diff --git a/src/Testing/EF6/EF6NetFramework/Generated/Entities/BaseClass.generated.cs b/src/Testing/EF6/EF6NetFramework/Generated/Entities/BaseClass.generated.cs
index 341059bc0..9cef744e9 100644
--- a/src/Testing/EF6/EF6NetFramework/Generated/Entities/BaseClass.generated.cs
+++ b/src/Testing/EF6/EF6NetFramework/Generated/Entities/BaseClass.generated.cs
@@ -5,7 +5,7 @@
// 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.
//
-// Produced by Entity Framework Visual Editor v3.0.0.5
+// Produced by Entity Framework Visual Editor v3.0.4.4
// Source: https://github.com/msawczyn/EFDesigner
// Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=michaelsawczyn.EFDesigner
// Documentation: https://msawczyn.github.io/EFDesigner/
@@ -54,7 +54,6 @@ public BaseClass(string property0)
if (string.IsNullOrEmpty(property0)) throw new ArgumentNullException(nameof(property0));
this.Property0 = property0;
-
Init();
}
diff --git a/src/Testing/EF6/EF6NetFramework/Generated/Entities/BaseClassWithRequiredProperties.generated.cs b/src/Testing/EF6/EF6NetFramework/Generated/Entities/BaseClassWithRequiredProperties.generated.cs
index bb11478e3..3dc0f8810 100644
--- a/src/Testing/EF6/EF6NetFramework/Generated/Entities/BaseClassWithRequiredProperties.generated.cs
+++ b/src/Testing/EF6/EF6NetFramework/Generated/Entities/BaseClassWithRequiredProperties.generated.cs
@@ -5,7 +5,7 @@
// 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.
//
-// Produced by Entity Framework Visual Editor v3.0.0.5
+// Produced by Entity Framework Visual Editor v3.0.4.4
// Source: https://github.com/msawczyn/EFDesigner
// Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=michaelsawczyn.EFDesigner
// Documentation: https://msawczyn.github.io/EFDesigner/
@@ -54,7 +54,6 @@ public BaseClassWithRequiredProperties(string property0)
if (string.IsNullOrEmpty(property0)) throw new ArgumentNullException(nameof(property0));
this.Property0 = property0;
-
Init();
}
@@ -97,7 +96,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
diff --git a/src/Testing/EF6/EF6NetFramework/Generated/Entities/Child.generated.cs b/src/Testing/EF6/EF6NetFramework/Generated/Entities/Child.generated.cs
index 0f86b4e5d..c08c5be2f 100644
--- a/src/Testing/EF6/EF6NetFramework/Generated/Entities/Child.generated.cs
+++ b/src/Testing/EF6/EF6NetFramework/Generated/Entities/Child.generated.cs
@@ -5,7 +5,7 @@
// 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.
//
-// Produced by Entity Framework Visual Editor v3.0.0.5
+// Produced by Entity Framework Visual Editor v3.0.4.4
// Source: https://github.com/msawczyn/EFDesigner
// Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=michaelsawczyn.EFDesigner
// Documentation: https://msawczyn.github.io/EFDesigner/
@@ -57,12 +57,12 @@ public Child(global::Testing.Child parent, global::Testing.Master _master0)
{
if (parent == null) throw new ArgumentNullException(nameof(parent));
this.Parent = parent;
+ parent.Children.Add(this);
if (_master0 == null) throw new ArgumentNullException(nameof(_master0));
_master0.Children.Add(this);
this.Children = new System.Collections.ObjectModel.ObservableCollection();
-
Init();
}
@@ -106,7 +106,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
@@ -121,7 +121,11 @@ protected set
* Navigation properties
*************************************************************************/
+ ///
+ /// Backing field for Children
+ ///
protected ICollection _children;
+
public virtual ICollection Children
{
get
diff --git a/src/Testing/EF6/EF6NetFramework/Generated/Entities/ConcreteDerivedClass.generated.cs b/src/Testing/EF6/EF6NetFramework/Generated/Entities/ConcreteDerivedClass.generated.cs
index 698faec50..2bf056a64 100644
--- a/src/Testing/EF6/EF6NetFramework/Generated/Entities/ConcreteDerivedClass.generated.cs
+++ b/src/Testing/EF6/EF6NetFramework/Generated/Entities/ConcreteDerivedClass.generated.cs
@@ -5,7 +5,7 @@
// 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.
//
-// Produced by Entity Framework Visual Editor v3.0.0.5
+// Produced by Entity Framework Visual Editor v3.0.4.4
// Source: https://github.com/msawczyn/EFDesigner
// Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=michaelsawczyn.EFDesigner
// Documentation: https://msawczyn.github.io/EFDesigner/
@@ -54,7 +54,6 @@ public ConcreteDerivedClass(string property0)
if (string.IsNullOrEmpty(property0)) throw new ArgumentNullException(nameof(property0));
this.Property0 = property0;
-
Init();
}
diff --git a/src/Testing/EF6/EF6NetFramework/Generated/Entities/ConcreteDerivedClassWithRequiredProperties.generated.cs b/src/Testing/EF6/EF6NetFramework/Generated/Entities/ConcreteDerivedClassWithRequiredProperties.generated.cs
index f135d60dc..cd0cd503e 100644
--- a/src/Testing/EF6/EF6NetFramework/Generated/Entities/ConcreteDerivedClassWithRequiredProperties.generated.cs
+++ b/src/Testing/EF6/EF6NetFramework/Generated/Entities/ConcreteDerivedClassWithRequiredProperties.generated.cs
@@ -5,7 +5,7 @@
// 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.
//
-// Produced by Entity Framework Visual Editor v3.0.0.5
+// Produced by Entity Framework Visual Editor v3.0.4.4
// Source: https://github.com/msawczyn/EFDesigner
// Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=michaelsawczyn.EFDesigner
// Documentation: https://msawczyn.github.io/EFDesigner/
@@ -58,7 +58,6 @@ public ConcreteDerivedClassWithRequiredProperties(string property1, string prope
if (string.IsNullOrEmpty(property0)) throw new ArgumentNullException(nameof(property0));
this.Property0 = property0;
-
Init();
}
diff --git a/src/Testing/EF6/EF6NetFramework/Generated/Entities/DerivedClass.generated.cs b/src/Testing/EF6/EF6NetFramework/Generated/Entities/DerivedClass.generated.cs
index b77f70ab0..9ebb7ce28 100644
--- a/src/Testing/EF6/EF6NetFramework/Generated/Entities/DerivedClass.generated.cs
+++ b/src/Testing/EF6/EF6NetFramework/Generated/Entities/DerivedClass.generated.cs
@@ -5,7 +5,7 @@
// 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.
//
-// Produced by Entity Framework Visual Editor v3.0.0.5
+// Produced by Entity Framework Visual Editor v3.0.4.4
// Source: https://github.com/msawczyn/EFDesigner
// Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=michaelsawczyn.EFDesigner
// Documentation: https://msawczyn.github.io/EFDesigner/
@@ -54,7 +54,6 @@ public DerivedClass(string property0)
if (string.IsNullOrEmpty(property0)) throw new ArgumentNullException(nameof(property0));
this.Property0 = property0;
-
Init();
}
@@ -161,7 +160,7 @@ public int Id1
GetId1(ref value);
return (_id1 = value);
}
- protected set
+ set
{
int oldValue = _id1;
SetId1(oldValue, ref value);
diff --git a/src/Testing/EF6/EF6NetFramework/Generated/Entities/HiddenEntity.generated.cs b/src/Testing/EF6/EF6NetFramework/Generated/Entities/HiddenEntity.generated.cs
index 02237acc7..14cc1b719 100644
--- a/src/Testing/EF6/EF6NetFramework/Generated/Entities/HiddenEntity.generated.cs
+++ b/src/Testing/EF6/EF6NetFramework/Generated/Entities/HiddenEntity.generated.cs
@@ -5,7 +5,7 @@
// 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.
//
-// Produced by Entity Framework Visual Editor v3.0.0.5
+// Produced by Entity Framework Visual Editor v3.0.4.4
// Source: https://github.com/msawczyn/EFDesigner
// Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=michaelsawczyn.EFDesigner
// Documentation: https://msawczyn.github.io/EFDesigner/
@@ -67,7 +67,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
diff --git a/src/Testing/EF6/EF6NetFramework/Generated/Entities/Master.generated.cs b/src/Testing/EF6/EF6NetFramework/Generated/Entities/Master.generated.cs
index 7a4844675..65a007086 100644
--- a/src/Testing/EF6/EF6NetFramework/Generated/Entities/Master.generated.cs
+++ b/src/Testing/EF6/EF6NetFramework/Generated/Entities/Master.generated.cs
@@ -5,7 +5,7 @@
// 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.
//
-// Produced by Entity Framework Visual Editor v3.0.0.5
+// Produced by Entity Framework Visual Editor v3.0.4.4
// Source: https://github.com/msawczyn/EFDesigner
// Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=michaelsawczyn.EFDesigner
// Documentation: https://msawczyn.github.io/EFDesigner/
@@ -69,7 +69,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
@@ -84,7 +84,11 @@ protected set
* Navigation properties
*************************************************************************/
+ ///
+ /// Backing field for Children
+ ///
protected ICollection _children;
+
public virtual ICollection Children
{
get
diff --git a/src/Testing/EF6/EF6NetFramework/Generated/Entities/ParserTest.generated.cs b/src/Testing/EF6/EF6NetFramework/Generated/Entities/ParserTest.generated.cs
index 9ba108783..3edb53287 100644
--- a/src/Testing/EF6/EF6NetFramework/Generated/Entities/ParserTest.generated.cs
+++ b/src/Testing/EF6/EF6NetFramework/Generated/Entities/ParserTest.generated.cs
@@ -5,7 +5,7 @@
// 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.
//
-// Produced by Entity Framework Visual Editor v3.0.0.5
+// Produced by Entity Framework Visual Editor v3.0.4.4
// Source: https://github.com/msawczyn/EFDesigner
// Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=michaelsawczyn.EFDesigner
// Documentation: https://msawczyn.github.io/EFDesigner/
@@ -53,7 +53,6 @@ public ParserTest(long foo)
{
this.foo = foo;
-
Init();
}
@@ -96,7 +95,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
diff --git a/src/Testing/EF6/EF6NetFramework/Generated/Entities/RenamedColumn.generated.cs b/src/Testing/EF6/EF6NetFramework/Generated/Entities/RenamedColumn.generated.cs
index 628e23785..4e4c15000 100644
--- a/src/Testing/EF6/EF6NetFramework/Generated/Entities/RenamedColumn.generated.cs
+++ b/src/Testing/EF6/EF6NetFramework/Generated/Entities/RenamedColumn.generated.cs
@@ -5,7 +5,7 @@
// 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.
//
-// Produced by Entity Framework Visual Editor v3.0.0.5
+// Produced by Entity Framework Visual Editor v3.0.4.4
// Source: https://github.com/msawczyn/EFDesigner
// Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=michaelsawczyn.EFDesigner
// Documentation: https://msawczyn.github.io/EFDesigner/
@@ -67,7 +67,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
diff --git a/src/Testing/EF6/EF6NetFramework/Generated/Entities/SpatialProperties.generated.cs b/src/Testing/EF6/EF6NetFramework/Generated/Entities/SpatialProperties.generated.cs
index 51320c292..7f3d8bc60 100644
--- a/src/Testing/EF6/EF6NetFramework/Generated/Entities/SpatialProperties.generated.cs
+++ b/src/Testing/EF6/EF6NetFramework/Generated/Entities/SpatialProperties.generated.cs
@@ -5,7 +5,7 @@
// 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.
//
-// Produced by Entity Framework Visual Editor v3.0.0.5
+// Produced by Entity Framework Visual Editor v3.0.4.4
// Source: https://github.com/msawczyn/EFDesigner
// Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=michaelsawczyn.EFDesigner
// Documentation: https://msawczyn.github.io/EFDesigner/
@@ -110,7 +110,6 @@ public SpatialProperties(DbGeography attrgeography, DbGeography attrgeographycol
if (attrgeometrypoint == null) throw new ArgumentNullException(nameof(attrgeometrypoint));
this.AttrGeometryPoint = attrgeometrypoint;
-
Init();
}
@@ -167,7 +166,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
diff --git a/src/Testing/EF6/EF6NetFramework/Generated/Entities/UChild.generated.cs b/src/Testing/EF6/EF6NetFramework/Generated/Entities/UChild.generated.cs
index 10d2cd53a..c262f07a5 100644
--- a/src/Testing/EF6/EF6NetFramework/Generated/Entities/UChild.generated.cs
+++ b/src/Testing/EF6/EF6NetFramework/Generated/Entities/UChild.generated.cs
@@ -5,7 +5,7 @@
// 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.
//
-// Produced by Entity Framework Visual Editor v3.0.0.5
+// Produced by Entity Framework Visual Editor v3.0.4.4
// Source: https://github.com/msawczyn/EFDesigner
// Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=michaelsawczyn.EFDesigner
// Documentation: https://msawczyn.github.io/EFDesigner/
@@ -64,7 +64,6 @@ public UChild(global::Testing.UParentRequired _uparentrequired1, global::Testing
if (_uparentrequired2 == null) throw new ArgumentNullException(nameof(_uparentrequired2));
_uparentrequired2.UChildOptional = this;
-
Init();
}
@@ -108,7 +107,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
diff --git a/src/Testing/EF6/EF6NetFramework/Generated/Entities/UParentCollection.generated.cs b/src/Testing/EF6/EF6NetFramework/Generated/Entities/UParentCollection.generated.cs
index df552f352..4bc82ce35 100644
--- a/src/Testing/EF6/EF6NetFramework/Generated/Entities/UParentCollection.generated.cs
+++ b/src/Testing/EF6/EF6NetFramework/Generated/Entities/UParentCollection.generated.cs
@@ -5,7 +5,7 @@
// 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.
//
-// Produced by Entity Framework Visual Editor v3.0.0.5
+// Produced by Entity Framework Visual Editor v3.0.4.4
// Source: https://github.com/msawczyn/EFDesigner
// Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=michaelsawczyn.EFDesigner
// Documentation: https://msawczyn.github.io/EFDesigner/
@@ -58,7 +58,6 @@ public UParentCollection(global::Testing.UChild uchildrequired)
this.UChildRequired = uchildrequired;
this.UChildCollection = new System.Collections.ObjectModel.ObservableCollection();
-
Init();
}
@@ -101,7 +100,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
@@ -116,8 +115,19 @@ protected set
* Navigation properties
*************************************************************************/
+ ///
+ /// Backing field for UChildRequired
+ ///
protected global::Testing.UChild _uChildRequired;
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before setting.
+ ///
partial void SetUChildRequired(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before returning.
+ ///
partial void GetUChildRequired(ref global::Testing.UChild result);
///
@@ -142,7 +152,11 @@ protected set
}
}
+ ///
+ /// Backing field for UChildCollection
+ ///
protected ICollection _uChildCollection;
+
public virtual ICollection UChildCollection
{
get
@@ -155,8 +169,19 @@ private set
}
}
+ ///
+ /// Backing field for UChildOptional
+ ///
protected global::Testing.UChild _uChildOptional;
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before setting.
+ ///
partial void SetUChildOptional(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before returning.
+ ///
partial void GetUChildOptional(ref global::Testing.UChild result);
public virtual global::Testing.UChild UChildOptional
diff --git a/src/Testing/EF6/EF6NetFramework/Generated/Entities/UParentOptional.generated.cs b/src/Testing/EF6/EF6NetFramework/Generated/Entities/UParentOptional.generated.cs
index 33147e3be..5a41cd8f3 100644
--- a/src/Testing/EF6/EF6NetFramework/Generated/Entities/UParentOptional.generated.cs
+++ b/src/Testing/EF6/EF6NetFramework/Generated/Entities/UParentOptional.generated.cs
@@ -5,7 +5,7 @@
// 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.
//
-// Produced by Entity Framework Visual Editor v3.0.0.5
+// Produced by Entity Framework Visual Editor v3.0.4.4
// Source: https://github.com/msawczyn/EFDesigner
// Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=michaelsawczyn.EFDesigner
// Documentation: https://msawczyn.github.io/EFDesigner/
@@ -28,7 +28,8 @@ namespace Testing
///
/// x
///
- public partial class UParentOptional: global::Testing.HiddenEntity, INotifyPropertyChanged
+ [System.ComponentModel.Description("x")]
+ public partial class UParentOptional: global::Testing.HiddenEntity
{
partial void Init();
@@ -63,7 +64,6 @@ public UParentOptional(global::Testing.UChild uchildrequired)
this.UChildRequired = uchildrequired;
this.UChildCollection = new System.Collections.ObjectModel.ObservableCollection();
-
Init();
}
@@ -119,13 +119,25 @@ public string PropertyInChild
* Navigation properties
*************************************************************************/
+ ///
+ /// Backing field for UChildOptional
+ ///
protected global::Testing.UChild _uChildOptional;
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before setting.
+ ///
partial void SetUChildOptional(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before returning.
+ ///
partial void GetUChildOptional(ref global::Testing.UChild result);
///
/// x
///
+ [Description("x")]
public virtual global::Testing.UChild UChildOptional
{
get
@@ -145,10 +157,15 @@ public string PropertyInChild
}
}
+ ///
+ /// Backing field for UChildCollection
+ ///
protected ICollection _uChildCollection;
+
///
/// h
///
+ [Description("h")]
public virtual ICollection UChildCollection
{
get
@@ -161,8 +178,19 @@ private set
}
}
+ ///
+ /// Backing field for UChildRequired
+ ///
protected global::Testing.UChild _uChildRequired;
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before setting.
+ ///
partial void SetUChildRequired(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before returning.
+ ///
partial void GetUChildRequired(ref global::Testing.UChild result);
///
@@ -187,13 +215,6 @@ private set
}
}
- public virtual event PropertyChangedEventHandler PropertyChanged;
-
- protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
- }
-
}
}
diff --git a/src/Testing/EF6/EF6NetFramework/Generated/Entities/UParentRequired.generated.cs b/src/Testing/EF6/EF6NetFramework/Generated/Entities/UParentRequired.generated.cs
index 28e95fbff..169f1ca09 100644
--- a/src/Testing/EF6/EF6NetFramework/Generated/Entities/UParentRequired.generated.cs
+++ b/src/Testing/EF6/EF6NetFramework/Generated/Entities/UParentRequired.generated.cs
@@ -5,7 +5,7 @@
// 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.
//
-// Produced by Entity Framework Visual Editor v3.0.0.5
+// Produced by Entity Framework Visual Editor v3.0.4.4
// Source: https://github.com/msawczyn/EFDesigner
// Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=michaelsawczyn.EFDesigner
// Documentation: https://msawczyn.github.io/EFDesigner/
@@ -70,7 +70,7 @@ public int Id
GetId(ref value);
return (_id = value);
}
- protected set
+ set
{
int oldValue = _id;
SetId(oldValue, ref value);
@@ -85,8 +85,19 @@ protected set
* Navigation properties
*************************************************************************/
+ ///
+ /// Backing field for UChildRequired
+ ///
protected global::Testing.UChild _uChildRequired;
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before setting.
+ ///
partial void SetUChildRequired(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before returning.
+ ///
partial void GetUChildRequired(ref global::Testing.UChild result);
///
@@ -111,7 +122,11 @@ protected set
}
}
+ ///
+ /// Backing field for UChildCollection
+ ///
protected ICollection _uChildCollection;
+
public virtual ICollection UChildCollection
{
get
@@ -124,8 +139,19 @@ private set
}
}
+ ///
+ /// Backing field for UChildOptional
+ ///
protected global::Testing.UChild _uChildOptional;
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before setting.
+ ///
partial void SetUChildOptional(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before returning.
+ ///
partial void GetUChildOptional(ref global::Testing.UChild result);
public virtual global::Testing.UChild UChildOptional
diff --git a/src/Testing/EF6/EF6NetFramework/Generated/Enums/Enum1.generated.cs b/src/Testing/EF6/EF6NetFramework/Generated/Enums/Enum1.generated.cs
index dfa839238..7709980bd 100644
--- a/src/Testing/EF6/EF6NetFramework/Generated/Enums/Enum1.generated.cs
+++ b/src/Testing/EF6/EF6NetFramework/Generated/Enums/Enum1.generated.cs
@@ -5,7 +5,7 @@
// 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.
//
-// Produced by Entity Framework Visual Editor v3.0.0.5
+// Produced by Entity Framework Visual Editor v3.0.4.4
// Source: https://github.com/msawczyn/EFDesigner
// Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=michaelsawczyn.EFDesigner
// Documentation: https://msawczyn.github.io/EFDesigner/
diff --git a/src/Testing/EF6/EF6NetFramework/Generated/Enums/FlagEnum.generated.cs b/src/Testing/EF6/EF6NetFramework/Generated/Enums/FlagEnum.generated.cs
index 0ff250599..8066cf714 100644
--- a/src/Testing/EF6/EF6NetFramework/Generated/Enums/FlagEnum.generated.cs
+++ b/src/Testing/EF6/EF6NetFramework/Generated/Enums/FlagEnum.generated.cs
@@ -5,7 +5,7 @@
// 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.
//
-// Produced by Entity Framework Visual Editor v3.0.0.5
+// Produced by Entity Framework Visual Editor v3.0.4.4
// Source: https://github.com/msawczyn/EFDesigner
// Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=michaelsawczyn.EFDesigner
// Documentation: https://msawczyn.github.io/EFDesigner/
diff --git a/src/Testing/EF6/EF6NetStandard/AllFeatureModel.cs b/src/Testing/EF6/EF6NetStandard/AllFeatureModel.cs
index 6153a7d78..df68f9dc0 100644
--- a/src/Testing/EF6/EF6NetStandard/AllFeatureModel.cs
+++ b/src/Testing/EF6/EF6NetStandard/AllFeatureModel.cs
@@ -1 +1,551 @@
+//------------------------------------------------------------------------------
+//
+// 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;
+using System.Data.Entity.Spatial;
+
+namespace Testing
+{
+ public partial class AllPropertyTypesRequired
+ {
+ partial void Init();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected AllPropertyTypesRequired()
+ {
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static AllPropertyTypesRequired CreateAllPropertyTypesRequiredUnsafe()
+ {
+ return new AllPropertyTypesRequired();
+ }
+
+ ///
+ /// 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, TimeSpan timeattr, string stringattr)
+ {
+ this.BinaryAttr = binaryattr;
+
+ this.BooleanAttr = booleanattr;
+
+ this.ByteAttr = byteattr;
+
+ this.DateTimeAttr = datetimeattr;
+
+ this.DateTimeOffsetAttr = datetimeoffsetattr;
+
+ this.DecimalAttr = decimalattr;
+
+ this.DoubleAttr = doubleattr;
+
+ this.GuidAttr = guidattr;
+
+ this.Int16Attr = int16attr;
+
+ this.Int32Attr = int32attr;
+
+ this.Int64Attr = int64attr;
+
+ this.SingleAttr = singleattr;
+
+ this.TimeAttr = timeattr;
+
+ if (string.IsNullOrEmpty(stringattr)) throw new ArgumentNullException(nameof(stringattr));
+ this.StringAttr = stringattr;
+
+ 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, TimeSpan timeattr, string stringattr)
+ {
+ return new AllPropertyTypesRequired(binaryattr, booleanattr, byteattr, datetimeattr, datetimeoffsetattr, decimalattr, doubleattr, guidattr, int16attr, int32attr, int64attr, singleattr, timeattr, stringattr);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Identity, Required
+ ///
+ [Key]
+ [Required]
+ public int Id { get; set; }
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public byte[] BinaryAttr { get; set; }
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public bool BooleanAttr { get; set; }
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public byte ByteAttr { get; set; }
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public DateTime DateTimeAttr { get; set; }
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public DateTimeOffset DateTimeOffsetAttr { get; set; }
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public decimal DecimalAttr { get; set; }
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public double DoubleAttr { get; set; }
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public Guid GuidAttr { get; set; }
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public short Int16Attr { get; set; }
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public int Int32Attr { get; set; }
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public long Int64Attr { get; set; }
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public Single SingleAttr { get; set; }
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public TimeSpan TimeAttr { get; set; }
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public string StringAttr { get; set; }
+
+ }
+}
+
+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;
+using System.Data.Entity.Spatial;
+
+namespace Testing
+{
+ public partial class AllPropertyTypesOptional
+ {
+ partial void Init();
+
+ ///
+ /// Default constructor
+ ///
+ public AllPropertyTypesOptional()
+ {
+ Init();
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Identity, Required
+ ///
+ [Key]
+ [Required]
+ public int Id { get; set; }
+
+ public byte[] BinaryAttr { get; set; }
+
+ public bool? BooleanAttr { get; set; }
+
+ public byte? ByteAttr { get; set; }
+
+ public DateTime? DateTimeAttr { get; set; }
+
+ public DateTimeOffset? DateTimeOffsetAttr { get; set; }
+
+ public decimal? DecimalAttr { get; set; }
+
+ public double? DoubleAttr { get; set; }
+
+ public Guid? GuidAttr { get; set; }
+
+ public short? Int16Attr { get; set; }
+
+ public int? Int32Attr { get; set; }
+
+ public long? Int64Attr { get; set; }
+
+ public Single? SingleAttr { get; set; }
+
+ public TimeSpan? TimeAttr { get; set; }
+
+ public string StringAttr { get; set; }
+
+ }
+}
+
+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;
+using System.Data.Entity.Spatial;
+
+namespace Testing
+{
+ public partial class UParentRequired
+ {
+ partial void Init();
+
+ ///
+ /// Default constructor
+ ///
+ public UParentRequired()
+ {
+ UChildCollection = new System.Collections.ObjectModel.ObservableCollection();
+ UChildRequired = global::Testing.UChild.CreateUChildUnsafe();
+
+ Init();
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Identity, Indexed, Required
+ ///
+ [Key]
+ [Required]
+ public int Id { get; set; }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+
+ ///
+ /// Required
+ ///
+ public virtual global::Testing.UChild UChildRequired { get; set; }
+
+ public virtual ICollection UChildCollection { get; private set; }
+
+ public virtual global::Testing.UChild UChildOptional { get; set; }
+
+ }
+}
+
+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;
+using System.Data.Entity.Spatial;
+
+namespace Testing
+{
+ ///
+ /// x
+ ///
+ [System.ComponentModel.Description("x")]
+ public partial class UParentOptional: global::Testing.HiddenEntity
+ {
+ 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.ObjectModel.ObservableCollection();
+ UChildRequired = global::Testing.UChild.CreateUChildUnsafe();
+
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static UParentOptional CreateUParentOptionalUnsafe()
+ {
+ return new UParentOptional();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
+ ///
+ public UParentOptional(global::Testing.UChild uchildrequired)
+ {
+ this.PropertyInChild = "hello";
+ if (uchildrequired == null) throw new ArgumentNullException(nameof(uchildrequired));
+ this.UChildRequired = uchildrequired;
+
+ this.UChildCollection = new System.Collections.ObjectModel.ObservableCollection();
+ Init();
+ }
+
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ ///
+ public static UParentOptional Create(global::Testing.UChild uchildrequired)
+ {
+ return new UParentOptional(uchildrequired);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Default value = "hello"
+ ///
+ public string PropertyInChild { get; set; }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+
+ ///
+ /// x
+ ///
+ [Description("x")]
+ public virtual global::Testing.UChild UChildOptional { get; set; }
+
+ ///
+ /// h
+ ///
+ [Description("h")]
+ public virtual ICollection UChildCollection { get; private set; }
+
+ ///
+ /// Required
+ ///
+ public virtual global::Testing.UChild UChildRequired { get; set; }
+
+ }
+}
+
+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;
+using System.Data.Entity.Spatial;
+
+namespace Testing
+{
+ public partial class UParentCollection
+ {
+ partial void Init();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected UParentCollection()
+ {
+ UChildCollection = new System.Collections.ObjectModel.ObservableCollection();
+ UChildRequired = global::Testing.UChild.CreateUChildUnsafe();
+
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static UParentCollection CreateUParentCollectionUnsafe()
+ {
+ return new UParentCollection();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
+ ///
+ public UParentCollection(global::Testing.UChild uchildrequired)
+ {
+ if (uchildrequired == null) throw new ArgumentNullException(nameof(uchildrequired));
+ this.UChildRequired = uchildrequired;
+
+ this.UChildCollection = new System.Collections.ObjectModel.ObservableCollection();
+ Init();
+ }
+
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ ///
+ public static UParentCollection Create(global::Testing.UChild uchildrequired)
+ {
+ return new UParentCollection(uchildrequired);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Identity, Indexed, Required
+ ///
+ [Key]
+ [Required]
+ public int Id { get; set; }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+
+ ///
+ /// Required
+ ///
+ public virtual global::Testing.UChild UChildRequired { get; set; }
+
+ public virtual ICollection UChildCollection { get; private set; }
+
+ public virtual global::Testing.UChild UChildOptional { get; set; }
+
+ }
+}
+
+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;
+using System.Data.Entity.Spatial;
+
+namespace Testing
+{
+ public partial class UChild
+ {
+ partial void Init();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected UChild()
+ {
+ // NOTE: This class has one-to-one associations with UChild.
+ // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
+
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static UChild CreateUChildUnsafe()
+ {
+ return new UChild();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
diff --git a/src/Testing/EF6/EF6NetStandard/Generated/Context/AllFeatureModel.generated.cs b/src/Testing/EF6/EF6NetStandard/Generated/Context/AllFeatureModel.generated.cs
index c03b8e8de..63b8cbd8a 100644
--- a/src/Testing/EF6/EF6NetStandard/Generated/Context/AllFeatureModel.generated.cs
+++ b/src/Testing/EF6/EF6NetStandard/Generated/Context/AllFeatureModel.generated.cs
@@ -197,7 +197,7 @@ protected override void OnModelCreating(System.Data.Entity.DbModelBuilder modelB
modelBuilder.Entity().ToTable("Masters").HasKey(t => t.Id);
modelBuilder.Entity().Property(t => t.Id).IsRequired().HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
- modelBuilder.Entity().HasMany(x => x.Children).WithRequired().Map(x => x.MapKey("Master_Children_Id"));
+ modelBuilder.Entity().HasMany(x => x.Children).WithRequired().Map(x => x.MapKey("MasterChildrenId"));
modelBuilder.Entity().ToTable("ParserTests").HasKey(t => t.Id);
modelBuilder.Entity().Property(t => t.Id).IsRequired().HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
@@ -220,13 +220,13 @@ protected override void OnModelCreating(System.Data.Entity.DbModelBuilder modelB
modelBuilder.Entity();
modelBuilder.Entity().HasOptional(x => x.UChildOptional).WithOptionalDependent();
- modelBuilder.Entity().HasMany(x => x.UChildCollection).WithOptional().Map(x => x.MapKey("UParentOptional_UChildCollection_Id"));
+ modelBuilder.Entity().HasMany(x => x.UChildCollection).WithOptional().Map(x => x.MapKey("UParentOptionalUChildCollectionId"));
modelBuilder.Entity().HasRequired(x => x.UChildRequired).WithOptional();
modelBuilder.Entity().ToTable("UParentRequireds").HasKey(t => t.Id);
modelBuilder.Entity().Property(t => t.Id).IsRequired().HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
modelBuilder.Entity().HasRequired(x => x.UChildRequired).WithRequiredDependent();
- modelBuilder.Entity().HasMany(x => x.UChildCollection).WithRequired().Map(x => x.MapKey("UParentRequired_UChildCollection_Id"));
+ modelBuilder.Entity().HasMany(x => x.UChildCollection).WithRequired().Map(x => x.MapKey("UParentRequiredUChildCollectionId"));
modelBuilder.Entity().HasOptional(x => x.UChildOptional).WithRequired().WillCascadeOnDelete(true);
OnModelCreatedImpl(modelBuilder);
diff --git a/src/Testing/EF6/EF6NetStandard/Generated/Entities/AbstractBaseClass.generated.cs b/src/Testing/EF6/EF6NetStandard/Generated/Entities/AbstractBaseClass.generated.cs
index 3353e2694..f4e0834fa 100644
--- a/src/Testing/EF6/EF6NetStandard/Generated/Entities/AbstractBaseClass.generated.cs
+++ b/src/Testing/EF6/EF6NetStandard/Generated/Entities/AbstractBaseClass.generated.cs
@@ -40,7 +40,6 @@ protected AbstractBaseClass(string property0)
if (string.IsNullOrEmpty(property0)) throw new ArgumentNullException(nameof(property0));
this.Property0 = property0;
-
Init();
}
diff --git a/src/Testing/EF6/EF6NetStandard/Generated/Entities/AllPropertyTypesOptional.generated.cs b/src/Testing/EF6/EF6NetStandard/Generated/Entities/AllPropertyTypesOptional.generated.cs
index 842f5c5e4..50048a83f 100644
--- a/src/Testing/EF6/EF6NetStandard/Generated/Entities/AllPropertyTypesOptional.generated.cs
+++ b/src/Testing/EF6/EF6NetStandard/Generated/Entities/AllPropertyTypesOptional.generated.cs
@@ -35,490 +35,40 @@ public AllPropertyTypesOptional()
* Properties
*************************************************************************/
- ///
- /// Backing field for Id
- ///
- protected int _id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
-
///
/// Identity, Required
///
[Key]
[Required]
- public int Id
- {
- get
- {
- int value = _id;
- GetId(ref value);
- return (_id = value);
- }
- protected set
- {
- int oldValue = _id;
- SetId(oldValue, ref value);
- if (oldValue != value)
- {
- _id = value;
- }
- }
- }
+ public int Id { get; set; }
- ///
- /// Backing field for BinaryAttr
- ///
- protected byte[] _binaryAttr;
- ///
- /// When provided in a partial class, allows value of BinaryAttr to be changed before setting.
- ///
- partial void SetBinaryAttr(byte[] oldValue, ref byte[] newValue);
- ///
- /// When provided in a partial class, allows value of BinaryAttr to be changed before returning.
- ///
- 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);
- if (oldValue != value)
- {
- _binaryAttr = value;
- }
- }
- }
+ public byte[] BinaryAttr { get; set; }
- ///
- /// Backing field for BooleanAttr
- ///
- protected bool? _booleanAttr;
- ///
- /// When provided in a partial class, allows value of BooleanAttr to be changed before setting.
- ///
- partial void SetBooleanAttr(bool? oldValue, ref bool? newValue);
- ///
- /// When provided in a partial class, allows value of BooleanAttr to be changed before returning.
- ///
- partial void GetBooleanAttr(ref bool? result);
+ public bool? BooleanAttr { get; set; }
- public bool? BooleanAttr
- {
- get
- {
- bool? value = _booleanAttr;
- GetBooleanAttr(ref value);
- return (_booleanAttr = value);
- }
- set
- {
- bool? oldValue = _booleanAttr;
- SetBooleanAttr(oldValue, ref value);
- if (oldValue != value)
- {
- _booleanAttr = value;
- }
- }
- }
+ public byte? ByteAttr { get; set; }
- ///
- /// Backing field for ByteAttr
- ///
- protected byte? _byteAttr;
- ///
- /// When provided in a partial class, allows value of ByteAttr to be changed before setting.
- ///
- partial void SetByteAttr(byte? oldValue, ref byte? newValue);
- ///
- /// When provided in a partial class, allows value of ByteAttr to be changed before returning.
- ///
- partial void GetByteAttr(ref byte? result);
+ public DateTime? DateTimeAttr { get; set; }
- public byte? ByteAttr
- {
- get
- {
- byte? value = _byteAttr;
- GetByteAttr(ref value);
- return (_byteAttr = value);
- }
- set
- {
- byte? oldValue = _byteAttr;
- SetByteAttr(oldValue, ref value);
- if (oldValue != value)
- {
- _byteAttr = value;
- }
- }
- }
+ public DateTimeOffset? DateTimeOffsetAttr { get; set; }
- ///
- /// Backing field for DateTimeAttr
- ///
- protected DateTime? _dateTimeAttr;
- ///
- /// When provided in a partial class, allows value of DateTimeAttr to be changed before setting.
- ///
- partial void SetDateTimeAttr(DateTime? oldValue, ref DateTime? newValue);
- ///
- /// When provided in a partial class, allows value of DateTimeAttr to be changed before returning.
- ///
- partial void GetDateTimeAttr(ref DateTime? result);
+ public decimal? DecimalAttr { get; set; }
- public DateTime? DateTimeAttr
- {
- get
- {
- DateTime? value = _dateTimeAttr;
- GetDateTimeAttr(ref value);
- return (_dateTimeAttr = value);
- }
- set
- {
- DateTime? oldValue = _dateTimeAttr;
- SetDateTimeAttr(oldValue, ref value);
- if (oldValue != value)
- {
- _dateTimeAttr = value;
- }
- }
- }
+ public double? DoubleAttr { get; set; }
- ///
- /// Backing field for DateTimeOffsetAttr
- ///
- protected DateTimeOffset? _dateTimeOffsetAttr;
- ///
- /// When provided in a partial class, allows value of DateTimeOffsetAttr to be changed before setting.
- ///
- partial void SetDateTimeOffsetAttr(DateTimeOffset? oldValue, ref DateTimeOffset? newValue);
- ///
- /// When provided in a partial class, allows value of DateTimeOffsetAttr to be changed before returning.
- ///
- partial void GetDateTimeOffsetAttr(ref DateTimeOffset? result);
+ public Guid? GuidAttr { get; set; }
- public DateTimeOffset? DateTimeOffsetAttr
- {
- get
- {
- DateTimeOffset? value = _dateTimeOffsetAttr;
- GetDateTimeOffsetAttr(ref value);
- return (_dateTimeOffsetAttr = value);
- }
- set
- {
- DateTimeOffset? oldValue = _dateTimeOffsetAttr;
- SetDateTimeOffsetAttr(oldValue, ref value);
- if (oldValue != value)
- {
- _dateTimeOffsetAttr = value;
- }
- }
- }
+ public short? Int16Attr { get; set; }
- ///
- /// Backing field for DecimalAttr
- ///
- protected decimal? _decimalAttr;
- ///
- /// When provided in a partial class, allows value of DecimalAttr to be changed before setting.
- ///
- partial void SetDecimalAttr(decimal? oldValue, ref decimal? newValue);
- ///
- /// When provided in a partial class, allows value of DecimalAttr to be changed before returning.
- ///
- partial void GetDecimalAttr(ref decimal? result);
+ public int? Int32Attr { get; set; }
- public decimal? DecimalAttr
- {
- get
- {
- decimal? value = _decimalAttr;
- GetDecimalAttr(ref value);
- return (_decimalAttr = value);
- }
- set
- {
- decimal? oldValue = _decimalAttr;
- SetDecimalAttr(oldValue, ref value);
- if (oldValue != value)
- {
- _decimalAttr = value;
- }
- }
- }
+ public long? Int64Attr { get; set; }
- ///
- /// Backing field for DoubleAttr
- ///
- protected double? _doubleAttr;
- ///
- /// When provided in a partial class, allows value of DoubleAttr to be changed before setting.
- ///
- partial void SetDoubleAttr(double? oldValue, ref double? newValue);
- ///
- /// When provided in a partial class, allows value of DoubleAttr to be changed before returning.
- ///
- partial void GetDoubleAttr(ref double? result);
+ public Single? SingleAttr { get; set; }
- public double? DoubleAttr
- {
- get
- {
- double? value = _doubleAttr;
- GetDoubleAttr(ref value);
- return (_doubleAttr = value);
- }
- set
- {
- double? oldValue = _doubleAttr;
- SetDoubleAttr(oldValue, ref value);
- if (oldValue != value)
- {
- _doubleAttr = value;
- }
- }
- }
+ public TimeSpan? TimeAttr { get; set; }
- ///
- /// Backing field for GuidAttr
- ///
- protected Guid? _guidAttr;
- ///
- /// When provided in a partial class, allows value of GuidAttr to be changed before setting.
- ///
- partial void SetGuidAttr(Guid? oldValue, ref Guid? newValue);
- ///
- /// When provided in a partial class, allows value of GuidAttr to be changed before returning.
- ///
- 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);
- if (oldValue != value)
- {
- _guidAttr = value;
- }
- }
- }
-
- ///
- /// Backing field for Int16Attr
- ///
- protected short? _int16Attr;
- ///
- /// When provided in a partial class, allows value of Int16Attr to be changed before setting.
- ///
- partial void SetInt16Attr(short? oldValue, ref short? newValue);
- ///
- /// When provided in a partial class, allows value of Int16Attr to be changed before returning.
- ///
- 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);
- if (oldValue != value)
- {
- _int16Attr = value;
- }
- }
- }
-
- ///
- /// Backing field for Int32Attr
- ///
- protected int? _int32Attr;
- ///
- /// When provided in a partial class, allows value of Int32Attr to be changed before setting.
- ///
- partial void SetInt32Attr(int? oldValue, ref int? newValue);
- ///
- /// When provided in a partial class, allows value of Int32Attr to be changed before returning.
- ///
- 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);
- if (oldValue != value)
- {
- _int32Attr = value;
- }
- }
- }
-
- ///
- /// Backing field for Int64Attr
- ///
- protected long? _int64Attr;
- ///
- /// When provided in a partial class, allows value of Int64Attr to be changed before setting.
- ///
- partial void SetInt64Attr(long? oldValue, ref long? newValue);
- ///
- /// When provided in a partial class, allows value of Int64Attr to be changed before returning.
- ///
- 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);
- if (oldValue != value)
- {
- _int64Attr = value;
- }
- }
- }
-
- ///
- /// Backing field for SingleAttr
- ///
- protected Single? _singleAttr;
- ///
- /// When provided in a partial class, allows value of SingleAttr to be changed before setting.
- ///
- partial void SetSingleAttr(Single? oldValue, ref Single? newValue);
- ///
- /// When provided in a partial class, allows value of SingleAttr to be changed before returning.
- ///
- 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);
- if (oldValue != value)
- {
- _singleAttr = value;
- }
- }
- }
-
- ///
- /// Backing field for TimeAttr
- ///
- protected TimeSpan? _timeAttr;
- ///
- /// When provided in a partial class, allows value of TimeAttr to be changed before setting.
- ///
- partial void SetTimeAttr(TimeSpan? oldValue, ref TimeSpan? newValue);
- ///
- /// When provided in a partial class, allows value of TimeAttr to be changed before returning.
- ///
- 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);
- if (oldValue != value)
- {
- _timeAttr = value;
- }
- }
- }
-
- ///
- /// Backing field for StringAttr
- ///
- protected string _stringAttr;
- ///
- /// When provided in a partial class, allows value of StringAttr to be changed before setting.
- ///
- partial void SetStringAttr(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of StringAttr to be changed before returning.
- ///
- partial void GetStringAttr(ref string result);
-
- public string StringAttr
- {
- get
- {
- string value = _stringAttr;
- GetStringAttr(ref value);
- return (_stringAttr = value);
- }
- set
- {
- string oldValue = _stringAttr;
- SetStringAttr(oldValue, ref value);
- if (oldValue != value)
- {
- _stringAttr = value;
- }
- }
- }
+ public string StringAttr { get; set; }
}
}
diff --git a/src/Testing/EF6/EF6NetStandard/Generated/Entities/AllPropertyTypesRequired.generated.cs b/src/Testing/EF6/EF6NetStandard/Generated/Entities/AllPropertyTypesRequired.generated.cs
index 71b7fc2dd..a6757d223 100644
--- a/src/Testing/EF6/EF6NetStandard/Generated/Entities/AllPropertyTypesRequired.generated.cs
+++ b/src/Testing/EF6/EF6NetStandard/Generated/Entities/AllPropertyTypesRequired.generated.cs
@@ -87,7 +87,6 @@ public AllPropertyTypesRequired(byte[] binaryattr, bool booleanattr, byte byteat
if (string.IsNullOrEmpty(stringattr)) throw new ArgumentNullException(nameof(stringattr));
this.StringAttr = stringattr;
-
Init();
}
@@ -117,546 +116,96 @@ public static AllPropertyTypesRequired Create(byte[] binaryattr, bool booleanatt
* Properties
*************************************************************************/
- ///
- /// Backing field for Id
- ///
- protected int _id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
-
///
/// Identity, Required
///
[Key]
[Required]
- public int Id
- {
- get
- {
- int value = _id;
- GetId(ref value);
- return (_id = value);
- }
- protected set
- {
- int oldValue = _id;
- SetId(oldValue, ref value);
- if (oldValue != value)
- {
- _id = value;
- }
- }
- }
-
- ///
- /// Backing field for BinaryAttr
- ///
- protected byte[] _binaryAttr;
- ///
- /// When provided in a partial class, allows value of BinaryAttr to be changed before setting.
- ///
- partial void SetBinaryAttr(byte[] oldValue, ref byte[] newValue);
- ///
- /// When provided in a partial class, allows value of BinaryAttr to be changed before returning.
- ///
- partial void GetBinaryAttr(ref byte[] result);
+ public int Id { get; set; }
///
/// Required
///
[Required]
- public byte[] BinaryAttr
- {
- get
- {
- byte[] value = _binaryAttr;
- GetBinaryAttr(ref value);
- return (_binaryAttr = value);
- }
- set
- {
- byte[] oldValue = _binaryAttr;
- SetBinaryAttr(oldValue, ref value);
- if (oldValue != value)
- {
- _binaryAttr = value;
- }
- }
- }
-
- ///
- /// Backing field for BooleanAttr
- ///
- protected bool _booleanAttr;
- ///
- /// When provided in a partial class, allows value of BooleanAttr to be changed before setting.
- ///
- partial void SetBooleanAttr(bool oldValue, ref bool newValue);
- ///
- /// When provided in a partial class, allows value of BooleanAttr to be changed before returning.
- ///
- partial void GetBooleanAttr(ref bool result);
+ public byte[] BinaryAttr { get; set; }
///
/// Required
///
[Required]
- public bool BooleanAttr
- {
- get
- {
- bool value = _booleanAttr;
- GetBooleanAttr(ref value);
- return (_booleanAttr = value);
- }
- set
- {
- bool oldValue = _booleanAttr;
- SetBooleanAttr(oldValue, ref value);
- if (oldValue != value)
- {
- _booleanAttr = value;
- }
- }
- }
-
- ///
- /// Backing field for ByteAttr
- ///
- protected byte _byteAttr;
- ///
- /// When provided in a partial class, allows value of ByteAttr to be changed before setting.
- ///
- partial void SetByteAttr(byte oldValue, ref byte newValue);
- ///
- /// When provided in a partial class, allows value of ByteAttr to be changed before returning.
- ///
- partial void GetByteAttr(ref byte result);
+ public bool BooleanAttr { get; set; }
///
/// Required
///
[Required]
- public byte ByteAttr
- {
- get
- {
- byte value = _byteAttr;
- GetByteAttr(ref value);
- return (_byteAttr = value);
- }
- set
- {
- byte oldValue = _byteAttr;
- SetByteAttr(oldValue, ref value);
- if (oldValue != value)
- {
- _byteAttr = value;
- }
- }
- }
-
- ///
- /// Backing field for DateTimeAttr
- ///
- protected DateTime _dateTimeAttr;
- ///
- /// When provided in a partial class, allows value of DateTimeAttr to be changed before setting.
- ///
- partial void SetDateTimeAttr(DateTime oldValue, ref DateTime newValue);
- ///
- /// When provided in a partial class, allows value of DateTimeAttr to be changed before returning.
- ///
- partial void GetDateTimeAttr(ref DateTime result);
+ public byte ByteAttr { get; set; }
///
/// Required
///
[Required]
- public DateTime DateTimeAttr
- {
- get
- {
- DateTime value = _dateTimeAttr;
- GetDateTimeAttr(ref value);
- return (_dateTimeAttr = value);
- }
- set
- {
- DateTime oldValue = _dateTimeAttr;
- SetDateTimeAttr(oldValue, ref value);
- if (oldValue != value)
- {
- _dateTimeAttr = value;
- }
- }
- }
-
- ///
- /// Backing field for DateTimeOffsetAttr
- ///
- protected DateTimeOffset _dateTimeOffsetAttr;
- ///
- /// When provided in a partial class, allows value of DateTimeOffsetAttr to be changed before setting.
- ///
- partial void SetDateTimeOffsetAttr(DateTimeOffset oldValue, ref DateTimeOffset newValue);
- ///
- /// When provided in a partial class, allows value of DateTimeOffsetAttr to be changed before returning.
- ///
- partial void GetDateTimeOffsetAttr(ref DateTimeOffset result);
+ public DateTime DateTimeAttr { get; set; }
///
/// Required
///
[Required]
- public DateTimeOffset DateTimeOffsetAttr
- {
- get
- {
- DateTimeOffset value = _dateTimeOffsetAttr;
- GetDateTimeOffsetAttr(ref value);
- return (_dateTimeOffsetAttr = value);
- }
- set
- {
- DateTimeOffset oldValue = _dateTimeOffsetAttr;
- SetDateTimeOffsetAttr(oldValue, ref value);
- if (oldValue != value)
- {
- _dateTimeOffsetAttr = value;
- }
- }
- }
-
- ///
- /// Backing field for DecimalAttr
- ///
- protected decimal _decimalAttr;
- ///
- /// When provided in a partial class, allows value of DecimalAttr to be changed before setting.
- ///
- partial void SetDecimalAttr(decimal oldValue, ref decimal newValue);
- ///
- /// When provided in a partial class, allows value of DecimalAttr to be changed before returning.
- ///
- partial void GetDecimalAttr(ref decimal result);
+ public DateTimeOffset DateTimeOffsetAttr { get; set; }
///
/// Required
///
[Required]
- public decimal DecimalAttr
- {
- get
- {
- decimal value = _decimalAttr;
- GetDecimalAttr(ref value);
- return (_decimalAttr = value);
- }
- set
- {
- decimal oldValue = _decimalAttr;
- SetDecimalAttr(oldValue, ref value);
- if (oldValue != value)
- {
- _decimalAttr = value;
- }
- }
- }
-
- ///
- /// Backing field for DoubleAttr
- ///
- protected double _doubleAttr;
- ///
- /// When provided in a partial class, allows value of DoubleAttr to be changed before setting.
- ///
- partial void SetDoubleAttr(double oldValue, ref double newValue);
- ///
- /// When provided in a partial class, allows value of DoubleAttr to be changed before returning.
- ///
- partial void GetDoubleAttr(ref double result);
+ public decimal DecimalAttr { get; set; }
///
/// Required
///
[Required]
- public double DoubleAttr
- {
- get
- {
- double value = _doubleAttr;
- GetDoubleAttr(ref value);
- return (_doubleAttr = value);
- }
- set
- {
- double oldValue = _doubleAttr;
- SetDoubleAttr(oldValue, ref value);
- if (oldValue != value)
- {
- _doubleAttr = value;
- }
- }
- }
-
- ///
- /// Backing field for GuidAttr
- ///
- protected Guid _guidAttr;
- ///
- /// When provided in a partial class, allows value of GuidAttr to be changed before setting.
- ///
- partial void SetGuidAttr(Guid oldValue, ref Guid newValue);
- ///
- /// When provided in a partial class, allows value of GuidAttr to be changed before returning.
- ///
- partial void GetGuidAttr(ref Guid result);
+ public double DoubleAttr { get; set; }
///
/// Required
///
[Required]
- public Guid GuidAttr
- {
- get
- {
- Guid value = _guidAttr;
- GetGuidAttr(ref value);
- return (_guidAttr = value);
- }
- set
- {
- Guid oldValue = _guidAttr;
- SetGuidAttr(oldValue, ref value);
- if (oldValue != value)
- {
- _guidAttr = value;
- }
- }
- }
-
- ///
- /// Backing field for Int16Attr
- ///
- protected short _int16Attr;
- ///
- /// When provided in a partial class, allows value of Int16Attr to be changed before setting.
- ///
- partial void SetInt16Attr(short oldValue, ref short newValue);
- ///
- /// When provided in a partial class, allows value of Int16Attr to be changed before returning.
- ///
- partial void GetInt16Attr(ref short result);
+ public Guid GuidAttr { get; set; }
///
/// Required
///
[Required]
- public short Int16Attr
- {
- get
- {
- short value = _int16Attr;
- GetInt16Attr(ref value);
- return (_int16Attr = value);
- }
- set
- {
- short oldValue = _int16Attr;
- SetInt16Attr(oldValue, ref value);
- if (oldValue != value)
- {
- _int16Attr = value;
- }
- }
- }
-
- ///
- /// Backing field for Int32Attr
- ///
- protected int _int32Attr;
- ///
- /// When provided in a partial class, allows value of Int32Attr to be changed before setting.
- ///
- partial void SetInt32Attr(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Int32Attr to be changed before returning.
- ///
- partial void GetInt32Attr(ref int result);
+ public short Int16Attr { get; set; }
///
/// Required
///
[Required]
- public int Int32Attr
- {
- get
- {
- int value = _int32Attr;
- GetInt32Attr(ref value);
- return (_int32Attr = value);
- }
- set
- {
- int oldValue = _int32Attr;
- SetInt32Attr(oldValue, ref value);
- if (oldValue != value)
- {
- _int32Attr = value;
- }
- }
- }
-
- ///
- /// Backing field for Int64Attr
- ///
- protected long _int64Attr;
- ///
- /// When provided in a partial class, allows value of Int64Attr to be changed before setting.
- ///
- partial void SetInt64Attr(long oldValue, ref long newValue);
- ///
- /// When provided in a partial class, allows value of Int64Attr to be changed before returning.
- ///
- partial void GetInt64Attr(ref long result);
+ public int Int32Attr { get; set; }
///
/// Required
///
[Required]
- public long Int64Attr
- {
- get
- {
- long value = _int64Attr;
- GetInt64Attr(ref value);
- return (_int64Attr = value);
- }
- set
- {
- long oldValue = _int64Attr;
- SetInt64Attr(oldValue, ref value);
- if (oldValue != value)
- {
- _int64Attr = value;
- }
- }
- }
-
- ///
- /// Backing field for SingleAttr
- ///
- protected Single _singleAttr;
- ///
- /// When provided in a partial class, allows value of SingleAttr to be changed before setting.
- ///
- partial void SetSingleAttr(Single oldValue, ref Single newValue);
- ///
- /// When provided in a partial class, allows value of SingleAttr to be changed before returning.
- ///
- partial void GetSingleAttr(ref Single result);
+ public long Int64Attr { get; set; }
///
/// Required
///
[Required]
- public Single SingleAttr
- {
- get
- {
- Single value = _singleAttr;
- GetSingleAttr(ref value);
- return (_singleAttr = value);
- }
- set
- {
- Single oldValue = _singleAttr;
- SetSingleAttr(oldValue, ref value);
- if (oldValue != value)
- {
- _singleAttr = value;
- }
- }
- }
-
- ///
- /// Backing field for TimeAttr
- ///
- protected TimeSpan _timeAttr;
- ///
- /// When provided in a partial class, allows value of TimeAttr to be changed before setting.
- ///
- partial void SetTimeAttr(TimeSpan oldValue, ref TimeSpan newValue);
- ///
- /// When provided in a partial class, allows value of TimeAttr to be changed before returning.
- ///
- partial void GetTimeAttr(ref TimeSpan result);
+ public Single SingleAttr { get; set; }
///
/// Required
///
[Required]
- public TimeSpan TimeAttr
- {
- get
- {
- TimeSpan value = _timeAttr;
- GetTimeAttr(ref value);
- return (_timeAttr = value);
- }
- set
- {
- TimeSpan oldValue = _timeAttr;
- SetTimeAttr(oldValue, ref value);
- if (oldValue != value)
- {
- _timeAttr = value;
- }
- }
- }
-
- ///
- /// Backing field for StringAttr
- ///
- protected string _stringAttr;
- ///
- /// When provided in a partial class, allows value of StringAttr to be changed before setting.
- ///
- partial void SetStringAttr(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of StringAttr to be changed before returning.
- ///
- partial void GetStringAttr(ref string result);
+ public TimeSpan TimeAttr { get; set; }
///
/// Required
///
[Required]
- public string StringAttr
- {
- get
- {
- string value = _stringAttr;
- GetStringAttr(ref value);
- return (_stringAttr = value);
- }
- set
- {
- string oldValue = _stringAttr;
- SetStringAttr(oldValue, ref value);
- if (oldValue != value)
- {
- _stringAttr = value;
- }
- }
- }
+ public string StringAttr { get; set; }
}
}
diff --git a/src/Testing/EF6/EF6NetStandard/Generated/Entities/BChild.generated.cs b/src/Testing/EF6/EF6NetStandard/Generated/Entities/BChild.generated.cs
index 0dbd921ef..7e03c9331 100644
--- a/src/Testing/EF6/EF6NetStandard/Generated/Entities/BChild.generated.cs
+++ b/src/Testing/EF6/EF6NetStandard/Generated/Entities/BChild.generated.cs
@@ -61,14 +61,15 @@ public BChild(global::Testing.BParentRequired bparentrequired, global::Testing.B
if (bparentrequired == null) throw new ArgumentNullException(nameof(bparentrequired));
this.BParentRequired = bparentrequired;
+ bparentrequired.BChildOptional = this;
if (bparentrequired_2 == null) throw new ArgumentNullException(nameof(bparentrequired_2));
this.BParentRequired_2 = bparentrequired_2;
+ bparentrequired_2.BChildCollection.Add(this);
this.BParentCollection = new System.Collections.ObjectModel.ObservableCollection();
this.BParentCollection_1 = new System.Collections.ObjectModel.ObservableCollection();
this.BParentCollection_2 = new System.Collections.ObjectModel.ObservableCollection();
-
Init();
}
@@ -86,232 +87,43 @@ public static BChild Create(global::Testing.BParentRequired bparentrequired, glo
* Properties
*************************************************************************/
- ///
- /// Backing field for Id
- ///
- internal int _id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
-
///
/// Identity, Indexed, Required
///
[Key]
[Required]
- public int Id
- {
- get
- {
- int value = _id;
- GetId(ref value);
- return (_id = value);
- }
- protected set
- {
- int oldValue = _id;
- SetId(oldValue, ref value);
- if (oldValue != value)
- {
- _id = value;
- }
- }
- }
+ public int Id { get; set; }
/*************************************************************************
* Navigation properties
*************************************************************************/
- protected global::Testing.BParentRequired _bParentRequired;
- partial void SetBParentRequired(global::Testing.BParentRequired oldValue, ref global::Testing.BParentRequired newValue);
- partial void GetBParentRequired(ref global::Testing.BParentRequired result);
-
///
/// Required
///
- public virtual global::Testing.BParentRequired BParentRequired
- {
- get
- {
- global::Testing.BParentRequired value = _bParentRequired;
- GetBParentRequired(ref value);
- return (_bParentRequired = value);
- }
- set
- {
- global::Testing.BParentRequired oldValue = _bParentRequired;
- SetBParentRequired(oldValue, ref value);
- if (oldValue != value)
- {
- _bParentRequired = value;
- }
- }
- }
-
- protected global::Testing.BParentRequired _bParentRequired_1;
- partial void SetBParentRequired_1(global::Testing.BParentRequired oldValue, ref global::Testing.BParentRequired newValue);
- partial void GetBParentRequired_1(ref global::Testing.BParentRequired result);
+ public virtual global::Testing.BParentRequired BParentRequired { get; set; }
///
/// Required
///
- public virtual global::Testing.BParentRequired BParentRequired_1
- {
- get
- {
- global::Testing.BParentRequired value = _bParentRequired_1;
- GetBParentRequired_1(ref value);
- return (_bParentRequired_1 = value);
- }
- set
- {
- global::Testing.BParentRequired oldValue = _bParentRequired_1;
- SetBParentRequired_1(oldValue, ref value);
- if (oldValue != value)
- {
- _bParentRequired_1 = value;
- }
- }
- }
-
- protected global::Testing.BParentRequired _bParentRequired_2;
- partial void SetBParentRequired_2(global::Testing.BParentRequired oldValue, ref global::Testing.BParentRequired newValue);
- partial void GetBParentRequired_2(ref global::Testing.BParentRequired result);
+ public virtual global::Testing.BParentRequired BParentRequired_1 { get; set; }
///
/// Required
///
- public virtual global::Testing.BParentRequired BParentRequired_2
- {
- get
- {
- global::Testing.BParentRequired value = _bParentRequired_2;
- GetBParentRequired_2(ref value);
- return (_bParentRequired_2 = value);
- }
- set
- {
- global::Testing.BParentRequired oldValue = _bParentRequired_2;
- SetBParentRequired_2(oldValue, ref value);
- if (oldValue != value)
- {
- _bParentRequired_2 = value;
- }
- }
- }
+ public virtual global::Testing.BParentRequired BParentRequired_2 { get; set; }
- protected ICollection _bParentCollection;
- public virtual ICollection BParentCollection
- {
- get
- {
- return _bParentCollection;
- }
- private set
- {
- _bParentCollection = value;
- }
- }
+ public virtual ICollection BParentCollection { get; private set; }
- protected ICollection _bParentCollection_1;
- public virtual ICollection BParentCollection_1
- {
- get
- {
- return _bParentCollection_1;
- }
- private set
- {
- _bParentCollection_1 = value;
- }
- }
+ public virtual ICollection BParentCollection_1 { get; private set; }
- protected ICollection _bParentCollection_2;
- public virtual ICollection BParentCollection_2
- {
- get
- {
- return _bParentCollection_2;
- }
- private set
- {
- _bParentCollection_2 = value;
- }
- }
+ public virtual ICollection BParentCollection_2 { get; private set; }
- protected global::Testing.BParentOptional _bParentOptional;
- partial void SetBParentOptional(global::Testing.BParentOptional oldValue, ref global::Testing.BParentOptional newValue);
- partial void GetBParentOptional(ref global::Testing.BParentOptional result);
+ public virtual global::Testing.BParentOptional BParentOptional { get; set; }
- public virtual global::Testing.BParentOptional BParentOptional
- {
- get
- {
- global::Testing.BParentOptional value = _bParentOptional;
- GetBParentOptional(ref value);
- return (_bParentOptional = value);
- }
- set
- {
- global::Testing.BParentOptional oldValue = _bParentOptional;
- SetBParentOptional(oldValue, ref value);
- if (oldValue != value)
- {
- _bParentOptional = value;
- }
- }
- }
-
- protected global::Testing.BParentOptional _bParentOptional_1;
- partial void SetBParentOptional_1(global::Testing.BParentOptional oldValue, ref global::Testing.BParentOptional newValue);
- partial void GetBParentOptional_1(ref global::Testing.BParentOptional result);
-
- public virtual global::Testing.BParentOptional BParentOptional_1
- {
- get
- {
- global::Testing.BParentOptional value = _bParentOptional_1;
- GetBParentOptional_1(ref value);
- return (_bParentOptional_1 = value);
- }
- set
- {
- global::Testing.BParentOptional oldValue = _bParentOptional_1;
- SetBParentOptional_1(oldValue, ref value);
- if (oldValue != value)
- {
- _bParentOptional_1 = value;
- }
- }
- }
-
- protected global::Testing.BParentOptional _bParentOptional_2;
- partial void SetBParentOptional_2(global::Testing.BParentOptional oldValue, ref global::Testing.BParentOptional newValue);
- partial void GetBParentOptional_2(ref global::Testing.BParentOptional result);
+ public virtual global::Testing.BParentOptional BParentOptional_1 { get; set; }
- public virtual global::Testing.BParentOptional BParentOptional_2
- {
- get
- {
- global::Testing.BParentOptional value = _bParentOptional_2;
- GetBParentOptional_2(ref value);
- return (_bParentOptional_2 = value);
- }
- set
- {
- global::Testing.BParentOptional oldValue = _bParentOptional_2;
- SetBParentOptional_2(oldValue, ref value);
- if (oldValue != value)
- {
- _bParentOptional_2 = value;
- }
- }
- }
+ public virtual global::Testing.BParentOptional BParentOptional_2 { get; set; }
}
}
diff --git a/src/Testing/EF6/EF6NetStandard/Generated/Entities/BParentCollection.generated.cs b/src/Testing/EF6/EF6NetStandard/Generated/Entities/BParentCollection.generated.cs
index 0e6e96396..049ae3d0e 100644
--- a/src/Testing/EF6/EF6NetStandard/Generated/Entities/BParentCollection.generated.cs
+++ b/src/Testing/EF6/EF6NetStandard/Generated/Entities/BParentCollection.generated.cs
@@ -50,9 +50,9 @@ public BParentCollection(global::Testing.BChild bchildrequired)
{
if (bchildrequired == null) throw new ArgumentNullException(nameof(bchildrequired));
this.BChildRequired = bchildrequired;
+ bchildrequired.BParentCollection.Add(this);
this.BChildCollection = new System.Collections.ObjectModel.ObservableCollection();
-
Init();
}
@@ -69,108 +69,25 @@ public static BParentCollection Create(global::Testing.BChild bchildrequired)
* Properties
*************************************************************************/
- ///
- /// Backing field for Id
- ///
- internal int _id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
-
///
/// Identity, Indexed, Required
///
[Key]
[Required]
- public int Id
- {
- get
- {
- int value = _id;
- GetId(ref value);
- return (_id = value);
- }
- protected set
- {
- int oldValue = _id;
- SetId(oldValue, ref value);
- if (oldValue != value)
- {
- _id = value;
- }
- }
- }
+ public int Id { get; set; }
/*************************************************************************
* Navigation properties
*************************************************************************/
- protected global::Testing.BChild _bChildRequired;
- partial void SetBChildRequired(global::Testing.BChild oldValue, ref global::Testing.BChild newValue);
- partial void GetBChildRequired(ref global::Testing.BChild result);
-
///
/// Required
///
- public virtual global::Testing.BChild BChildRequired
- {
- get
- {
- global::Testing.BChild value = _bChildRequired;
- GetBChildRequired(ref value);
- return (_bChildRequired = value);
- }
- set
- {
- global::Testing.BChild oldValue = _bChildRequired;
- SetBChildRequired(oldValue, ref value);
- if (oldValue != value)
- {
- _bChildRequired = value;
- }
- }
- }
+ public virtual global::Testing.BChild BChildRequired { get; set; }
- protected ICollection _bChildCollection;
- public virtual ICollection BChildCollection
- {
- get
- {
- return _bChildCollection;
- }
- private set
- {
- _bChildCollection = value;
- }
- }
-
- protected global::Testing.BChild _bChildOptional;
- partial void SetBChildOptional(global::Testing.BChild oldValue, ref global::Testing.BChild newValue);
- partial void GetBChildOptional(ref global::Testing.BChild result);
+ public virtual ICollection BChildCollection { get; private set; }
- public virtual global::Testing.BChild BChildOptional
- {
- get
- {
- global::Testing.BChild value = _bChildOptional;
- GetBChildOptional(ref value);
- return (_bChildOptional = value);
- }
- set
- {
- global::Testing.BChild oldValue = _bChildOptional;
- SetBChildOptional(oldValue, ref value);
- if (oldValue != value)
- {
- _bChildOptional = value;
- }
- }
- }
+ public virtual global::Testing.BChild BChildOptional { get; set; }
}
}
diff --git a/src/Testing/EF6/EF6NetStandard/Generated/Entities/BParentOptional.generated.cs b/src/Testing/EF6/EF6NetStandard/Generated/Entities/BParentOptional.generated.cs
index 806647949..0133d5bbb 100644
--- a/src/Testing/EF6/EF6NetStandard/Generated/Entities/BParentOptional.generated.cs
+++ b/src/Testing/EF6/EF6NetStandard/Generated/Entities/BParentOptional.generated.cs
@@ -50,9 +50,9 @@ public BParentOptional(global::Testing.BChild bchildrequired)
{
if (bchildrequired == null) throw new ArgumentNullException(nameof(bchildrequired));
this.BChildRequired = bchildrequired;
+ bchildrequired.BParentOptional = this;
this.BChildCollection = new System.Collections.ObjectModel.ObservableCollection();
-
Init();
}
@@ -69,108 +69,25 @@ public static BParentOptional Create(global::Testing.BChild bchildrequired)
* Properties
*************************************************************************/
- ///
- /// Backing field for Id
- ///
- internal int _id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
-
///
/// Identity, Indexed, Required
///
[Key]
[Required]
- public int Id
- {
- get
- {
- int value = _id;
- GetId(ref value);
- return (_id = value);
- }
- protected set
- {
- int oldValue = _id;
- SetId(oldValue, ref value);
- if (oldValue != value)
- {
- _id = value;
- }
- }
- }
+ public int Id { get; set; }
/*************************************************************************
* Navigation properties
*************************************************************************/
- protected global::Testing.BChild _bChildRequired;
- partial void SetBChildRequired(global::Testing.BChild oldValue, ref global::Testing.BChild newValue);
- partial void GetBChildRequired(ref global::Testing.BChild result);
-
///
/// Required
///
- public virtual global::Testing.BChild BChildRequired
- {
- get
- {
- global::Testing.BChild value = _bChildRequired;
- GetBChildRequired(ref value);
- return (_bChildRequired = value);
- }
- set
- {
- global::Testing.BChild oldValue = _bChildRequired;
- SetBChildRequired(oldValue, ref value);
- if (oldValue != value)
- {
- _bChildRequired = value;
- }
- }
- }
+ public virtual global::Testing.BChild BChildRequired { get; set; }
- protected ICollection _bChildCollection;
- public virtual ICollection BChildCollection
- {
- get
- {
- return _bChildCollection;
- }
- private set
- {
- _bChildCollection = value;
- }
- }
-
- protected global::Testing.BChild _bChildOptional;
- partial void SetBChildOptional(global::Testing.BChild oldValue, ref global::Testing.BChild newValue);
- partial void GetBChildOptional(ref global::Testing.BChild result);
+ public virtual ICollection BChildCollection { get; private set; }
- public virtual global::Testing.BChild BChildOptional
- {
- get
- {
- global::Testing.BChild value = _bChildOptional;
- GetBChildOptional(ref value);
- return (_bChildOptional = value);
- }
- set
- {
- global::Testing.BChild oldValue = _bChildOptional;
- SetBChildOptional(oldValue, ref value);
- if (oldValue != value)
- {
- _bChildOptional = value;
- }
- }
- }
+ public virtual global::Testing.BChild BChildOptional { get; set; }
}
}
diff --git a/src/Testing/EF6/EF6NetStandard/Generated/Entities/BParentRequired.generated.cs b/src/Testing/EF6/EF6NetStandard/Generated/Entities/BParentRequired.generated.cs
index 12f9a0c02..82fa40d65 100644
--- a/src/Testing/EF6/EF6NetStandard/Generated/Entities/BParentRequired.generated.cs
+++ b/src/Testing/EF6/EF6NetStandard/Generated/Entities/BParentRequired.generated.cs
@@ -38,108 +38,25 @@ public BParentRequired()
* Properties
*************************************************************************/
- ///
- /// Backing field for Id
- ///
- internal int _id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
-
///
/// Identity, Indexed, Required
///
[Key]
[Required]
- public int Id
- {
- get
- {
- int value = _id;
- GetId(ref value);
- return (_id = value);
- }
- protected set
- {
- int oldValue = _id;
- SetId(oldValue, ref value);
- if (oldValue != value)
- {
- _id = value;
- }
- }
- }
+ public int Id { get; set; }
/*************************************************************************
* Navigation properties
*************************************************************************/
- protected global::Testing.BChild _bChildOptional;
- partial void SetBChildOptional(global::Testing.BChild oldValue, ref global::Testing.BChild newValue);
- partial void GetBChildOptional(ref global::Testing.BChild result);
-
- public virtual global::Testing.BChild BChildOptional
- {
- get
- {
- global::Testing.BChild value = _bChildOptional;
- GetBChildOptional(ref value);
- return (_bChildOptional = value);
- }
- set
- {
- global::Testing.BChild oldValue = _bChildOptional;
- SetBChildOptional(oldValue, ref value);
- if (oldValue != value)
- {
- _bChildOptional = value;
- }
- }
- }
-
- protected global::Testing.BChild _bChildRequired;
- partial void SetBChildRequired(global::Testing.BChild oldValue, ref global::Testing.BChild newValue);
- partial void GetBChildRequired(ref global::Testing.BChild result);
+ public virtual global::Testing.BChild BChildOptional { get; set; }
///
/// Required
///
- public virtual global::Testing.BChild BChildRequired
- {
- get
- {
- global::Testing.BChild value = _bChildRequired;
- GetBChildRequired(ref value);
- return (_bChildRequired = value);
- }
- set
- {
- global::Testing.BChild oldValue = _bChildRequired;
- SetBChildRequired(oldValue, ref value);
- if (oldValue != value)
- {
- _bChildRequired = value;
- }
- }
- }
+ public virtual global::Testing.BChild BChildRequired { get; set; }
- protected ICollection _bChildCollection;
- public virtual ICollection BChildCollection
- {
- get
- {
- return _bChildCollection;
- }
- private set
- {
- _bChildCollection = value;
- }
- }
+ public virtual ICollection BChildCollection { get; private set; }
}
}
diff --git a/src/Testing/EF6/EF6NetStandard/Generated/Entities/BaseClass.generated.cs b/src/Testing/EF6/EF6NetStandard/Generated/Entities/BaseClass.generated.cs
index d5d203554..4bc2c5c1c 100644
--- a/src/Testing/EF6/EF6NetStandard/Generated/Entities/BaseClass.generated.cs
+++ b/src/Testing/EF6/EF6NetStandard/Generated/Entities/BaseClass.generated.cs
@@ -48,7 +48,6 @@ public BaseClass(string property0)
if (string.IsNullOrEmpty(property0)) throw new ArgumentNullException(nameof(property0));
this.Property0 = property0;
-
Init();
}
diff --git a/src/Testing/EF6/EF6NetStandard/Generated/Entities/BaseClassWithRequiredProperties.generated.cs b/src/Testing/EF6/EF6NetStandard/Generated/Entities/BaseClassWithRequiredProperties.generated.cs
index ede9bbf22..069852ebd 100644
--- a/src/Testing/EF6/EF6NetStandard/Generated/Entities/BaseClassWithRequiredProperties.generated.cs
+++ b/src/Testing/EF6/EF6NetStandard/Generated/Entities/BaseClassWithRequiredProperties.generated.cs
@@ -48,7 +48,6 @@ public BaseClassWithRequiredProperties(string property0)
if (string.IsNullOrEmpty(property0)) throw new ArgumentNullException(nameof(property0));
this.Property0 = property0;
-
Init();
}
@@ -65,78 +64,18 @@ public static BaseClassWithRequiredProperties Create(string property0)
* Properties
*************************************************************************/
- ///
- /// Backing field for Id
- ///
- internal int _id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
-
///
/// Identity, Indexed, Required
///
[Key]
[Required]
- public int Id
- {
- get
- {
- int value = _id;
- GetId(ref value);
- return (_id = value);
- }
- protected set
- {
- int oldValue = _id;
- SetId(oldValue, ref value);
- if (oldValue != value)
- {
- _id = value;
- }
- }
- }
-
- ///
- /// Backing field for Property0
- ///
- protected string _property0;
- ///
- /// When provided in a partial class, allows value of Property0 to be changed before setting.
- ///
- partial void SetProperty0(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of Property0 to be changed before returning.
- ///
- partial void GetProperty0(ref string result);
+ public int Id { get; set; }
///
/// Required
///
[Required]
- public string Property0
- {
- get
- {
- string value = _property0;
- GetProperty0(ref value);
- return (_property0 = value);
- }
- set
- {
- string oldValue = _property0;
- SetProperty0(oldValue, ref value);
- if (oldValue != value)
- {
- _property0 = value;
- }
- }
- }
+ public string Property0 { get; set; }
}
}
diff --git a/src/Testing/EF6/EF6NetStandard/Generated/Entities/Child.generated.cs b/src/Testing/EF6/EF6NetStandard/Generated/Entities/Child.generated.cs
index efc217ead..7bade1ed7 100644
--- a/src/Testing/EF6/EF6NetStandard/Generated/Entities/Child.generated.cs
+++ b/src/Testing/EF6/EF6NetStandard/Generated/Entities/Child.generated.cs
@@ -51,12 +51,12 @@ public Child(global::Testing.Child parent, global::Testing.Master _master0)
{
if (parent == null) throw new ArgumentNullException(nameof(parent));
this.Parent = parent;
+ parent.Children.Add(this);
if (_master0 == null) throw new ArgumentNullException(nameof(_master0));
_master0.Children.Add(this);
this.Children = new System.Collections.ObjectModel.ObservableCollection();
-
Init();
}
@@ -74,85 +74,23 @@ public static Child Create(global::Testing.Child parent, global::Testing.Master
* Properties
*************************************************************************/
- ///
- /// Backing field for Id
- ///
- internal int _id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
-
///
/// Identity, Indexed, Required
///
[Key]
[Required]
- public int Id
- {
- get
- {
- int value = _id;
- GetId(ref value);
- return (_id = value);
- }
- protected set
- {
- int oldValue = _id;
- SetId(oldValue, ref value);
- if (oldValue != value)
- {
- _id = value;
- }
- }
- }
+ public int Id { get; set; }
/*************************************************************************
* Navigation properties
*************************************************************************/
- protected ICollection _children;
- public virtual ICollection Children
- {
- get
- {
- return _children;
- }
- private set
- {
- _children = value;
- }
- }
-
- protected global::Testing.Child _parent;
- partial void SetParent(global::Testing.Child oldValue, ref global::Testing.Child newValue);
- partial void GetParent(ref global::Testing.Child result);
+ public virtual ICollection Children { get; private set; }
///
/// Required
///
- public virtual global::Testing.Child Parent
- {
- get
- {
- global::Testing.Child value = _parent;
- GetParent(ref value);
- return (_parent = value);
- }
- set
- {
- global::Testing.Child oldValue = _parent;
- SetParent(oldValue, ref value);
- if (oldValue != value)
- {
- _parent = value;
- }
- }
- }
+ public virtual global::Testing.Child Parent { get; set; }
}
}
diff --git a/src/Testing/EF6/EF6NetStandard/Generated/Entities/ConcreteDerivedClass.generated.cs b/src/Testing/EF6/EF6NetStandard/Generated/Entities/ConcreteDerivedClass.generated.cs
index d8e84122f..d263a39e9 100644
--- a/src/Testing/EF6/EF6NetStandard/Generated/Entities/ConcreteDerivedClass.generated.cs
+++ b/src/Testing/EF6/EF6NetStandard/Generated/Entities/ConcreteDerivedClass.generated.cs
@@ -48,7 +48,6 @@ public ConcreteDerivedClass(string property0)
if (string.IsNullOrEmpty(property0)) throw new ArgumentNullException(nameof(property0));
this.Property0 = property0;
-
Init();
}
@@ -65,69 +64,9 @@ public ConcreteDerivedClass(string property0)
* Properties
*************************************************************************/
- ///
- /// Backing field for Property1
- ///
- protected string _property1;
- ///
- /// When provided in a partial class, allows value of Property1 to be changed before setting.
- ///
- partial void SetProperty1(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of Property1 to be changed before returning.
- ///
- 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);
- if (oldValue != value)
- {
- _property1 = value;
- }
- }
- }
+ public string Property1 { get; set; }
- ///
- /// Backing field for PropertyInChild
- ///
- protected string _propertyInChild;
- ///
- /// When provided in a partial class, allows value of PropertyInChild to be changed before setting.
- ///
- partial void SetPropertyInChild(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of PropertyInChild to be changed before returning.
- ///
- 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);
- if (oldValue != value)
- {
- _propertyInChild = value;
- }
- }
- }
+ public string PropertyInChild { get; set; }
}
}
diff --git a/src/Testing/EF6/EF6NetStandard/Generated/Entities/ConcreteDerivedClassWithRequiredProperties.generated.cs b/src/Testing/EF6/EF6NetStandard/Generated/Entities/ConcreteDerivedClassWithRequiredProperties.generated.cs
index e69317163..06f1add61 100644
--- a/src/Testing/EF6/EF6NetStandard/Generated/Entities/ConcreteDerivedClassWithRequiredProperties.generated.cs
+++ b/src/Testing/EF6/EF6NetStandard/Generated/Entities/ConcreteDerivedClassWithRequiredProperties.generated.cs
@@ -52,7 +52,6 @@ public ConcreteDerivedClassWithRequiredProperties(string property1, string prope
if (string.IsNullOrEmpty(property0)) throw new ArgumentNullException(nameof(property0));
this.Property0 = property0;
-
Init();
}
@@ -70,41 +69,11 @@ public static ConcreteDerivedClassWithRequiredProperties Create(string property1
* Properties
*************************************************************************/
- ///
- /// Backing field for Property1
- ///
- protected string _property1;
- ///
- /// When provided in a partial class, allows value of Property1 to be changed before setting.
- ///
- partial void SetProperty1(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of Property1 to be changed before returning.
- ///
- partial void GetProperty1(ref string result);
-
///
/// Required
///
[Required]
- public string Property1
- {
- get
- {
- string value = _property1;
- GetProperty1(ref value);
- return (_property1 = value);
- }
- set
- {
- string oldValue = _property1;
- SetProperty1(oldValue, ref value);
- if (oldValue != value)
- {
- _property1 = value;
- }
- }
- }
+ public string Property1 { get; set; }
}
}
diff --git a/src/Testing/EF6/EF6NetStandard/Generated/Entities/DerivedClass.generated.cs b/src/Testing/EF6/EF6NetStandard/Generated/Entities/DerivedClass.generated.cs
index 26776231a..a9e3f91e3 100644
--- a/src/Testing/EF6/EF6NetStandard/Generated/Entities/DerivedClass.generated.cs
+++ b/src/Testing/EF6/EF6NetStandard/Generated/Entities/DerivedClass.generated.cs
@@ -48,7 +48,6 @@ public DerivedClass(string property0)
if (string.IsNullOrEmpty(property0)) throw new ArgumentNullException(nameof(property0));
this.Property0 = property0;
-
Init();
}
@@ -65,69 +64,9 @@ public DerivedClass(string property0)
* Properties
*************************************************************************/
- ///
- /// Backing field for Property1
- ///
- protected string _property1;
- ///
- /// When provided in a partial class, allows value of Property1 to be changed before setting.
- ///
- partial void SetProperty1(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of Property1 to be changed before returning.
- ///
- 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);
- if (oldValue != value)
- {
- _property1 = value;
- }
- }
- }
+ public string Property1 { get; set; }
- ///
- /// Backing field for PropertyInChild
- ///
- protected string _propertyInChild;
- ///
- /// When provided in a partial class, allows value of PropertyInChild to be changed before setting.
- ///
- partial void SetPropertyInChild(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of PropertyInChild to be changed before returning.
- ///
- 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);
- if (oldValue != value)
- {
- _propertyInChild = value;
- }
- }
- }
+ public string PropertyInChild { get; set; }
}
}
diff --git a/src/Testing/EF6/EF6NetStandard/Generated/Entities/HiddenEntity.generated.cs b/src/Testing/EF6/EF6NetStandard/Generated/Entities/HiddenEntity.generated.cs
index 0568e94fe..483ecdb8b 100644
--- a/src/Testing/EF6/EF6NetStandard/Generated/Entities/HiddenEntity.generated.cs
+++ b/src/Testing/EF6/EF6NetStandard/Generated/Entities/HiddenEntity.generated.cs
@@ -35,42 +35,12 @@ protected HiddenEntity()
* Properties
*************************************************************************/
- ///
- /// Backing field for Id
- ///
- internal int _id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
-
///
/// Identity, Indexed, Required
///
[Key]
[Required]
- public int Id
- {
- get
- {
- int value = _id;
- GetId(ref value);
- return (_id = value);
- }
- protected set
- {
- int oldValue = _id;
- SetId(oldValue, ref value);
- if (oldValue != value)
- {
- _id = value;
- }
- }
- }
+ public int Id { get; set; }
}
}
diff --git a/src/Testing/EF6/EF6NetStandard/Generated/Entities/Master.generated.cs b/src/Testing/EF6/EF6NetStandard/Generated/Entities/Master.generated.cs
index 2ae49defd..b525e09c5 100644
--- a/src/Testing/EF6/EF6NetStandard/Generated/Entities/Master.generated.cs
+++ b/src/Testing/EF6/EF6NetStandard/Generated/Entities/Master.generated.cs
@@ -37,59 +37,18 @@ public Master()
* Properties
*************************************************************************/
- ///
- /// Backing field for Id
- ///
- internal int _id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
-
///
/// Identity, Indexed, Required
///
[Key]
[Required]
- public int Id
- {
- get
- {
- int value = _id;
- GetId(ref value);
- return (_id = value);
- }
- protected set
- {
- int oldValue = _id;
- SetId(oldValue, ref value);
- if (oldValue != value)
- {
- _id = value;
- }
- }
- }
+ public int Id { get; set; }
/*************************************************************************
* Navigation properties
*************************************************************************/
- protected ICollection _children;
- public virtual ICollection Children
- {
- get
- {
- return _children;
- }
- private set
- {
- _children = value;
- }
- }
+ public virtual ICollection Children { get; private set; }
}
}
diff --git a/src/Testing/EF6/EF6NetStandard/Generated/Entities/ParserTest.generated.cs b/src/Testing/EF6/EF6NetStandard/Generated/Entities/ParserTest.generated.cs
index 9538d5ba2..4df4c3ecb 100644
--- a/src/Testing/EF6/EF6NetStandard/Generated/Entities/ParserTest.generated.cs
+++ b/src/Testing/EF6/EF6NetStandard/Generated/Entities/ParserTest.generated.cs
@@ -47,7 +47,6 @@ public ParserTest(long foo)
{
this.foo = foo;
-
Init();
}
@@ -64,654 +63,54 @@ public static ParserTest Create(long foo)
* Properties
*************************************************************************/
- ///
- /// Backing field for Id
- ///
- protected int _id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
-
///
/// Identity, Required
///
[Key]
[Required]
- public int Id
- {
- get
- {
- int value = _id;
- GetId(ref value);
- return (_id = value);
- }
- protected set
- {
- int oldValue = _id;
- SetId(oldValue, ref value);
- if (oldValue != value)
- {
- _id = value;
- }
- }
- }
-
- ///
- /// Backing field for foo
- ///
- protected long _foo;
- ///
- /// When provided in a partial class, allows value of foo to be changed before setting.
- ///
- partial void Setfoo(long oldValue, ref long newValue);
- ///
- /// When provided in a partial class, allows value of foo to be changed before returning.
- ///
- partial void Getfoo(ref long result);
+ public int Id { get; set; }
///
/// Required
///
[Required]
- public long foo
- {
- get
- {
- long value = _foo;
- Getfoo(ref value);
- return (_foo = value);
- }
- set
- {
- long oldValue = _foo;
- Setfoo(oldValue, ref value);
- if (oldValue != value)
- {
- _foo = value;
- }
- }
- }
+ public long foo { get; set; }
- ///
- /// Backing field for name1
- ///
- protected string _name1;
- ///
- /// When provided in a partial class, allows value of name1 to be changed before setting.
- ///
- partial void Setname1(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of name1 to be changed before returning.
- ///
- partial void Getname1(ref string result);
+ public string name1 { get; set; }
- public string name1
- {
- get
- {
- string value = _name1;
- Getname1(ref value);
- return (_name1 = value);
- }
- set
- {
- string oldValue = _name1;
- Setname1(oldValue, ref value);
- if (oldValue != value)
- {
- _name1 = value;
- }
- }
- }
+ public string name2 { get; protected set; }
- ///
- /// Backing field for name2
- ///
- protected string _name2;
- ///
- /// When provided in a partial class, allows value of name2 to be changed before setting.
- ///
- partial void Setname2(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of name2 to be changed before returning.
- ///
- partial void Getname2(ref string result);
+ public int? name3 { get; set; }
- public string name2
- {
- get
- {
- string value = _name2;
- Getname2(ref value);
- return (_name2 = value);
- }
- protected set
- {
- string oldValue = _name2;
- Setname2(oldValue, ref value);
- if (oldValue != value)
- {
- _name2 = value;
- }
- }
- }
+ public int? name4 { get; protected set; }
- ///
- /// Backing field for name3
- ///
- protected int? _name3;
- ///
- /// When provided in a partial class, allows value of name3 to be changed before setting.
- ///
- partial void Setname3(int? oldValue, ref int? newValue);
- ///
- /// When provided in a partial class, allows value of name3 to be changed before returning.
- ///
- partial void Getname3(ref int? result);
+ public int? name5 { get; set; }
- public int? name3
- {
- get
- {
- int? value = _name3;
- Getname3(ref value);
- return (_name3 = value);
- }
- set
- {
- int? oldValue = _name3;
- Setname3(oldValue, ref value);
- if (oldValue != value)
- {
- _name3 = value;
- }
- }
- }
+ public int? name6 { get; protected set; }
- ///
- /// Backing field for name4
- ///
- protected int? _name4;
- ///
- /// When provided in a partial class, allows value of name4 to be changed before setting.
- ///
- partial void Setname4(int? oldValue, ref int? newValue);
- ///
- /// When provided in a partial class, allows value of name4 to be changed before returning.
- ///
- partial void Getname4(ref int? result);
+ public string name7 { get; set; }
- public int? name4
- {
- get
- {
- int? value = _name4;
- Getname4(ref value);
- return (_name4 = value);
- }
- protected set
- {
- int? oldValue = _name4;
- Setname4(oldValue, ref value);
- if (oldValue != value)
- {
- _name4 = value;
- }
- }
- }
+ public string name8 { get; protected set; }
- ///
- /// Backing field for name5
- ///
- protected int? _name5;
- ///
- /// When provided in a partial class, allows value of name5 to be changed before setting.
- ///
- partial void Setname5(int? oldValue, ref int? newValue);
- ///
- /// When provided in a partial class, allows value of name5 to be changed before returning.
- ///
- partial void Getname5(ref int? result);
+ public string name9 { get; set; }
- public int? name5
- {
- get
- {
- int? value = _name5;
- Getname5(ref value);
- return (_name5 = value);
- }
- set
- {
- int? oldValue = _name5;
- Setname5(oldValue, ref value);
- if (oldValue != value)
- {
- _name5 = value;
- }
- }
- }
+ public string name { get; protected set; }
- ///
- /// Backing field for name6
- ///
- protected int? _name6;
- ///
- /// When provided in a partial class, allows value of name6 to be changed before setting.
- ///
- partial void Setname6(int? oldValue, ref int? newValue);
- ///
- /// When provided in a partial class, allows value of name6 to be changed before returning.
- ///
- partial void Getname6(ref int? result);
+ public int? name11 { get; set; }
- public int? name6
- {
- get
- {
- int? value = _name6;
- Getname6(ref value);
- return (_name6 = value);
- }
- protected set
- {
- int? oldValue = _name6;
- Setname6(oldValue, ref value);
- if (oldValue != value)
- {
- _name6 = value;
- }
- }
- }
+ public int? name12 { get; protected set; }
- ///
- /// Backing field for name7
- ///
- protected string _name7;
- ///
- /// When provided in a partial class, allows value of name7 to be changed before setting.
- ///
- partial void Setname7(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of name7 to be changed before returning.
- ///
- partial void Getname7(ref string result);
+ public int? name13 { get; set; }
- public string name7
- {
- get
- {
- string value = _name7;
- Getname7(ref value);
- return (_name7 = value);
- }
- set
- {
- string oldValue = _name7;
- Setname7(oldValue, ref value);
- if (oldValue != value)
- {
- _name7 = value;
- }
- }
- }
+ public int? name14 { get; protected set; }
- ///
- /// Backing field for name8
- ///
- protected string _name8;
- ///
- /// When provided in a partial class, allows value of name8 to be changed before setting.
- ///
- partial void Setname8(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of name8 to be changed before returning.
- ///
- partial void Getname8(ref string result);
+ public string name15 { get; set; }
- public string name8
- {
- get
- {
- string value = _name8;
- Getname8(ref value);
- return (_name8 = value);
- }
- protected set
- {
- string oldValue = _name8;
- Setname8(oldValue, ref value);
- if (oldValue != value)
- {
- _name8 = value;
- }
- }
- }
+ public string name16 { get; protected set; }
- ///
- /// Backing field for name9
- ///
- protected string _name9;
- ///
- /// When provided in a partial class, allows value of name9 to be changed before setting.
- ///
- partial void Setname9(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of name9 to be changed before returning.
- ///
- partial void Getname9(ref string result);
+ public string name17 { get; set; }
- public string name9
- {
- get
- {
- string value = _name9;
- Getname9(ref value);
- return (_name9 = value);
- }
- set
- {
- string oldValue = _name9;
- Setname9(oldValue, ref value);
- if (oldValue != value)
- {
- _name9 = value;
- }
- }
- }
-
- ///
- /// Backing field for name
- ///
- protected string _name;
- ///
- /// When provided in a partial class, allows value of name to be changed before setting.
- ///
- partial void Setname(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of name to be changed before returning.
- ///
- partial void Getname(ref string result);
-
- public string name
- {
- get
- {
- string value = _name;
- Getname(ref value);
- return (_name = value);
- }
- protected set
- {
- string oldValue = _name;
- Setname(oldValue, ref value);
- if (oldValue != value)
- {
- _name = value;
- }
- }
- }
-
- ///
- /// Backing field for name11
- ///
- protected int? _name11;
- ///
- /// When provided in a partial class, allows value of name11 to be changed before setting.
- ///
- partial void Setname11(int? oldValue, ref int? newValue);
- ///
- /// When provided in a partial class, allows value of name11 to be changed before returning.
- ///
- 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);
- if (oldValue != value)
- {
- _name11 = value;
- }
- }
- }
-
- ///
- /// Backing field for name12
- ///
- protected int? _name12;
- ///
- /// When provided in a partial class, allows value of name12 to be changed before setting.
- ///
- partial void Setname12(int? oldValue, ref int? newValue);
- ///
- /// When provided in a partial class, allows value of name12 to be changed before returning.
- ///
- 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);
- if (oldValue != value)
- {
- _name12 = value;
- }
- }
- }
-
- ///
- /// Backing field for name13
- ///
- protected int? _name13;
- ///
- /// When provided in a partial class, allows value of name13 to be changed before setting.
- ///
- partial void Setname13(int? oldValue, ref int? newValue);
- ///
- /// When provided in a partial class, allows value of name13 to be changed before returning.
- ///
- 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);
- if (oldValue != value)
- {
- _name13 = value;
- }
- }
- }
-
- ///
- /// Backing field for name14
- ///
- protected int? _name14;
- ///
- /// When provided in a partial class, allows value of name14 to be changed before setting.
- ///
- partial void Setname14(int? oldValue, ref int? newValue);
- ///
- /// When provided in a partial class, allows value of name14 to be changed before returning.
- ///
- 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);
- if (oldValue != value)
- {
- _name14 = value;
- }
- }
- }
-
- ///
- /// Backing field for name15
- ///
- protected string _name15;
- ///
- /// When provided in a partial class, allows value of name15 to be changed before setting.
- ///
- partial void Setname15(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of name15 to be changed before returning.
- ///
- partial void Getname15(ref string result);
-
- public string name15
- {
- get
- {
- string value = _name15;
- Getname15(ref value);
- return (_name15 = value);
- }
- set
- {
- string oldValue = _name15;
- Setname15(oldValue, ref value);
- if (oldValue != value)
- {
- _name15 = value;
- }
- }
- }
-
- ///
- /// Backing field for name16
- ///
- protected string _name16;
- ///
- /// When provided in a partial class, allows value of name16 to be changed before setting.
- ///
- partial void Setname16(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of name16 to be changed before returning.
- ///
- partial void Getname16(ref string result);
-
- public string name16
- {
- get
- {
- string value = _name16;
- Getname16(ref value);
- return (_name16 = value);
- }
- protected set
- {
- string oldValue = _name16;
- Setname16(oldValue, ref value);
- if (oldValue != value)
- {
- _name16 = value;
- }
- }
- }
-
- ///
- /// Backing field for name17
- ///
- protected string _name17;
- ///
- /// When provided in a partial class, allows value of name17 to be changed before setting.
- ///
- partial void Setname17(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of name17 to be changed before returning.
- ///
- partial void Getname17(ref string result);
-
- public string name17
- {
- get
- {
- string value = _name17;
- Getname17(ref value);
- return (_name17 = value);
- }
- set
- {
- string oldValue = _name17;
- Setname17(oldValue, ref value);
- if (oldValue != value)
- {
- _name17 = value;
- }
- }
- }
-
- ///
- /// Backing field for name18
- ///
- protected string _name18;
- ///
- /// When provided in a partial class, allows value of name18 to be changed before setting.
- ///
- partial void Setname18(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of name18 to be changed before returning.
- ///
- partial void Getname18(ref string result);
-
- public string name18
- {
- get
- {
- string value = _name18;
- Getname18(ref value);
- return (_name18 = value);
- }
- protected set
- {
- string oldValue = _name18;
- Setname18(oldValue, ref value);
- if (oldValue != value)
- {
- _name18 = value;
- }
- }
- }
+ public string name18 { get; protected set; }
}
}
diff --git a/src/Testing/EF6/EF6NetStandard/Generated/Entities/RenamedColumn.generated.cs b/src/Testing/EF6/EF6NetStandard/Generated/Entities/RenamedColumn.generated.cs
index d39ea6ec6..dc4dd2fc1 100644
--- a/src/Testing/EF6/EF6NetStandard/Generated/Entities/RenamedColumn.generated.cs
+++ b/src/Testing/EF6/EF6NetStandard/Generated/Entities/RenamedColumn.generated.cs
@@ -35,42 +35,12 @@ public RenamedColumn()
* Properties
*************************************************************************/
- ///
- /// Backing field for Id
- ///
- internal int _id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
-
///
/// Identity, Indexed, Required
///
[Key]
[Required]
- public int Id
- {
- get
- {
- int value = _id;
- GetId(ref value);
- return (_id = value);
- }
- protected set
- {
- int oldValue = _id;
- SetId(oldValue, ref value);
- if (oldValue != value)
- {
- _id = value;
- }
- }
- }
+ public int Id { get; set; }
}
}
diff --git a/src/Testing/EF6/EF6NetStandard/Generated/Entities/SpatialProperties.generated.cs b/src/Testing/EF6/EF6NetStandard/Generated/Entities/SpatialProperties.generated.cs
index 8923c5cbf..c7d2e3c1a 100644
--- a/src/Testing/EF6/EF6NetStandard/Generated/Entities/SpatialProperties.generated.cs
+++ b/src/Testing/EF6/EF6NetStandard/Generated/Entities/SpatialProperties.generated.cs
@@ -104,7 +104,6 @@ public SpatialProperties(DbGeography attrgeography, DbGeography attrgeographycol
if (attrgeometrypoint == null) throw new ArgumentNullException(nameof(attrgeometrypoint));
this.AttrGeometryPoint = attrgeometrypoint;
-
Init();
}
@@ -135,582 +134,102 @@ public static SpatialProperties Create(DbGeography attrgeography, DbGeography at
* Properties
*************************************************************************/
- ///
- /// Backing field for Id
- ///
- protected int _id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
-
///
/// Identity, Required
///
[Key]
[Required]
- public int Id
- {
- get
- {
- int value = _id;
- GetId(ref value);
- return (_id = value);
- }
- protected set
- {
- int oldValue = _id;
- SetId(oldValue, ref value);
- if (oldValue != value)
- {
- _id = value;
- }
- }
- }
-
- ///
- /// Backing field for AttrGeography
- ///
- protected DbGeography _attrGeography;
- ///
- /// When provided in a partial class, allows value of AttrGeography to be changed before setting.
- ///
- partial void SetAttrGeography(DbGeography oldValue, ref DbGeography newValue);
- ///
- /// When provided in a partial class, allows value of AttrGeography to be changed before returning.
- ///
- partial void GetAttrGeography(ref DbGeography result);
+ public int Id { get; set; }
///
/// Required
///
[Required]
- public DbGeography AttrGeography
- {
- get
- {
- DbGeography value = _attrGeography;
- GetAttrGeography(ref value);
- return (_attrGeography = value);
- }
- set
- {
- DbGeography oldValue = _attrGeography;
- SetAttrGeography(oldValue, ref value);
- if (oldValue != value)
- {
- _attrGeography = value;
- }
- }
- }
-
- ///
- /// Backing field for AttrGeographyCollection
- ///
- protected DbGeography _attrGeographyCollection;
- ///
- /// When provided in a partial class, allows value of AttrGeographyCollection to be changed before setting.
- ///
- partial void SetAttrGeographyCollection(DbGeography oldValue, ref DbGeography newValue);
- ///
- /// When provided in a partial class, allows value of AttrGeographyCollection to be changed before returning.
- ///
- partial void GetAttrGeographyCollection(ref DbGeography result);
+ public DbGeography AttrGeography { get; set; }
///
/// Required
///
[Required]
- public DbGeography AttrGeographyCollection
- {
- get
- {
- DbGeography value = _attrGeographyCollection;
- GetAttrGeographyCollection(ref value);
- return (_attrGeographyCollection = value);
- }
- set
- {
- DbGeography oldValue = _attrGeographyCollection;
- SetAttrGeographyCollection(oldValue, ref value);
- if (oldValue != value)
- {
- _attrGeographyCollection = value;
- }
- }
- }
-
- ///
- /// Backing field for AttrGeographyLineString
- ///
- protected DbGeography _attrGeographyLineString;
- ///
- /// When provided in a partial class, allows value of AttrGeographyLineString to be changed before setting.
- ///
- partial void SetAttrGeographyLineString(DbGeography oldValue, ref DbGeography newValue);
- ///
- /// When provided in a partial class, allows value of AttrGeographyLineString to be changed before returning.
- ///
- partial void GetAttrGeographyLineString(ref DbGeography result);
+ public DbGeography AttrGeographyCollection { get; set; }
///
/// Required
///
[Required]
- public DbGeography AttrGeographyLineString
- {
- get
- {
- DbGeography value = _attrGeographyLineString;
- GetAttrGeographyLineString(ref value);
- return (_attrGeographyLineString = value);
- }
- set
- {
- DbGeography oldValue = _attrGeographyLineString;
- SetAttrGeographyLineString(oldValue, ref value);
- if (oldValue != value)
- {
- _attrGeographyLineString = value;
- }
- }
- }
-
- ///
- /// Backing field for AttrGeographyMultiLineString
- ///
- protected DbGeography _attrGeographyMultiLineString;
- ///
- /// When provided in a partial class, allows value of AttrGeographyMultiLineString to be changed before setting.
- ///
- partial void SetAttrGeographyMultiLineString(DbGeography oldValue, ref DbGeography newValue);
- ///
- /// When provided in a partial class, allows value of AttrGeographyMultiLineString to be changed before returning.
- ///
- partial void GetAttrGeographyMultiLineString(ref DbGeography result);
+ public DbGeography AttrGeographyLineString { get; set; }
///
/// Required
///
[Required]
- public DbGeography AttrGeographyMultiLineString
- {
- get
- {
- DbGeography value = _attrGeographyMultiLineString;
- GetAttrGeographyMultiLineString(ref value);
- return (_attrGeographyMultiLineString = value);
- }
- set
- {
- DbGeography oldValue = _attrGeographyMultiLineString;
- SetAttrGeographyMultiLineString(oldValue, ref value);
- if (oldValue != value)
- {
- _attrGeographyMultiLineString = value;
- }
- }
- }
-
- ///
- /// Backing field for AttrGeographyMultiPoint
- ///
- protected DbGeography _attrGeographyMultiPoint;
- ///
- /// When provided in a partial class, allows value of AttrGeographyMultiPoint to be changed before setting.
- ///
- partial void SetAttrGeographyMultiPoint(DbGeography oldValue, ref DbGeography newValue);
- ///
- /// When provided in a partial class, allows value of AttrGeographyMultiPoint to be changed before returning.
- ///
- partial void GetAttrGeographyMultiPoint(ref DbGeography result);
+ public DbGeography AttrGeographyMultiLineString { get; set; }
///
/// Required
///
[Required]
- public DbGeography AttrGeographyMultiPoint
- {
- get
- {
- DbGeography value = _attrGeographyMultiPoint;
- GetAttrGeographyMultiPoint(ref value);
- return (_attrGeographyMultiPoint = value);
- }
- set
- {
- DbGeography oldValue = _attrGeographyMultiPoint;
- SetAttrGeographyMultiPoint(oldValue, ref value);
- if (oldValue != value)
- {
- _attrGeographyMultiPoint = value;
- }
- }
- }
-
- ///
- /// Backing field for AttrGeographyMultiPolygon
- ///
- protected DbGeography _attrGeographyMultiPolygon;
- ///
- /// When provided in a partial class, allows value of AttrGeographyMultiPolygon to be changed before setting.
- ///
- partial void SetAttrGeographyMultiPolygon(DbGeography oldValue, ref DbGeography newValue);
- ///
- /// When provided in a partial class, allows value of AttrGeographyMultiPolygon to be changed before returning.
- ///
- partial void GetAttrGeographyMultiPolygon(ref DbGeography result);
+ public DbGeography AttrGeographyMultiPoint { get; set; }
///
/// Required
///
[Required]
- public DbGeography AttrGeographyMultiPolygon
- {
- get
- {
- DbGeography value = _attrGeographyMultiPolygon;
- GetAttrGeographyMultiPolygon(ref value);
- return (_attrGeographyMultiPolygon = value);
- }
- set
- {
- DbGeography oldValue = _attrGeographyMultiPolygon;
- SetAttrGeographyMultiPolygon(oldValue, ref value);
- if (oldValue != value)
- {
- _attrGeographyMultiPolygon = value;
- }
- }
- }
-
- ///
- /// Backing field for AttrGeographyPoint
- ///
- protected DbGeography _attrGeographyPoint;
- ///
- /// When provided in a partial class, allows value of AttrGeographyPoint to be changed before setting.
- ///
- partial void SetAttrGeographyPoint(DbGeography oldValue, ref DbGeography newValue);
- ///
- /// When provided in a partial class, allows value of AttrGeographyPoint to be changed before returning.
- ///
- partial void GetAttrGeographyPoint(ref DbGeography result);
+ public DbGeography AttrGeographyMultiPolygon { get; set; }
///
/// Required
///
[Required]
- public DbGeography AttrGeographyPoint
- {
- get
- {
- DbGeography value = _attrGeographyPoint;
- GetAttrGeographyPoint(ref value);
- return (_attrGeographyPoint = value);
- }
- set
- {
- DbGeography oldValue = _attrGeographyPoint;
- SetAttrGeographyPoint(oldValue, ref value);
- if (oldValue != value)
- {
- _attrGeographyPoint = value;
- }
- }
- }
-
- ///
- /// Backing field for AttrGeographyPolygon
- ///
- protected DbGeography _attrGeographyPolygon;
- ///
- /// When provided in a partial class, allows value of AttrGeographyPolygon to be changed before setting.
- ///
- partial void SetAttrGeographyPolygon(DbGeography oldValue, ref DbGeography newValue);
- ///
- /// When provided in a partial class, allows value of AttrGeographyPolygon to be changed before returning.
- ///
- partial void GetAttrGeographyPolygon(ref DbGeography result);
+ public DbGeography AttrGeographyPoint { get; set; }
///
/// Required
///
[Required]
- public DbGeography AttrGeographyPolygon
- {
- get
- {
- DbGeography value = _attrGeographyPolygon;
- GetAttrGeographyPolygon(ref value);
- return (_attrGeographyPolygon = value);
- }
- set
- {
- DbGeography oldValue = _attrGeographyPolygon;
- SetAttrGeographyPolygon(oldValue, ref value);
- if (oldValue != value)
- {
- _attrGeographyPolygon = value;
- }
- }
- }
-
- ///
- /// Backing field for AttrGeometry
- ///
- protected DbGeometry _attrGeometry;
- ///
- /// When provided in a partial class, allows value of AttrGeometry to be changed before setting.
- ///
- partial void SetAttrGeometry(DbGeometry oldValue, ref DbGeometry newValue);
- ///
- /// When provided in a partial class, allows value of AttrGeometry to be changed before returning.
- ///
- partial void GetAttrGeometry(ref DbGeometry result);
+ public DbGeography AttrGeographyPolygon { get; set; }
///
/// Required
///
[Required]
- public DbGeometry AttrGeometry
- {
- get
- {
- DbGeometry value = _attrGeometry;
- GetAttrGeometry(ref value);
- return (_attrGeometry = value);
- }
- set
- {
- DbGeometry oldValue = _attrGeometry;
- SetAttrGeometry(oldValue, ref value);
- if (oldValue != value)
- {
- _attrGeometry = value;
- }
- }
- }
-
- ///
- /// Backing field for AttrGeometryCollection
- ///
- protected DbGeometry _attrGeometryCollection;
- ///
- /// When provided in a partial class, allows value of AttrGeometryCollection to be changed before setting.
- ///
- partial void SetAttrGeometryCollection(DbGeometry oldValue, ref DbGeometry newValue);
- ///
- /// When provided in a partial class, allows value of AttrGeometryCollection to be changed before returning.
- ///
- partial void GetAttrGeometryCollection(ref DbGeometry result);
+ public DbGeometry AttrGeometry { get; set; }
///
/// Required
///
[Required]
- public DbGeometry AttrGeometryCollection
- {
- get
- {
- DbGeometry value = _attrGeometryCollection;
- GetAttrGeometryCollection(ref value);
- return (_attrGeometryCollection = value);
- }
- set
- {
- DbGeometry oldValue = _attrGeometryCollection;
- SetAttrGeometryCollection(oldValue, ref value);
- if (oldValue != value)
- {
- _attrGeometryCollection = value;
- }
- }
- }
-
- ///
- /// Backing field for AttrGeometryLineString
- ///
- protected DbGeometry _attrGeometryLineString;
- ///
- /// When provided in a partial class, allows value of AttrGeometryLineString to be changed before setting.
- ///
- partial void SetAttrGeometryLineString(DbGeometry oldValue, ref DbGeometry newValue);
- ///
- /// When provided in a partial class, allows value of AttrGeometryLineString to be changed before returning.
- ///
- partial void GetAttrGeometryLineString(ref DbGeometry result);
+ public DbGeometry AttrGeometryCollection { get; set; }
///
/// Required
///
[Required]
- public DbGeometry AttrGeometryLineString
- {
- get
- {
- DbGeometry value = _attrGeometryLineString;
- GetAttrGeometryLineString(ref value);
- return (_attrGeometryLineString = value);
- }
- set
- {
- DbGeometry oldValue = _attrGeometryLineString;
- SetAttrGeometryLineString(oldValue, ref value);
- if (oldValue != value)
- {
- _attrGeometryLineString = value;
- }
- }
- }
-
- ///
- /// Backing field for AttrGeometryMultiLineString
- ///
- protected DbGeometry _attrGeometryMultiLineString;
- ///
- /// When provided in a partial class, allows value of AttrGeometryMultiLineString to be changed before setting.
- ///
- partial void SetAttrGeometryMultiLineString(DbGeometry oldValue, ref DbGeometry newValue);
- ///
- /// When provided in a partial class, allows value of AttrGeometryMultiLineString to be changed before returning.
- ///
- partial void GetAttrGeometryMultiLineString(ref DbGeometry result);
+ public DbGeometry AttrGeometryLineString { get; set; }
///
/// Required
///
[Required]
- public DbGeometry AttrGeometryMultiLineString
- {
- get
- {
- DbGeometry value = _attrGeometryMultiLineString;
- GetAttrGeometryMultiLineString(ref value);
- return (_attrGeometryMultiLineString = value);
- }
- set
- {
- DbGeometry oldValue = _attrGeometryMultiLineString;
- SetAttrGeometryMultiLineString(oldValue, ref value);
- if (oldValue != value)
- {
- _attrGeometryMultiLineString = value;
- }
- }
- }
-
- ///
- /// Backing field for AttrGeometryMultiPoint
- ///
- protected DbGeometry _attrGeometryMultiPoint;
- ///
- /// When provided in a partial class, allows value of AttrGeometryMultiPoint to be changed before setting.
- ///
- partial void SetAttrGeometryMultiPoint(DbGeometry oldValue, ref DbGeometry newValue);
- ///
- /// When provided in a partial class, allows value of AttrGeometryMultiPoint to be changed before returning.
- ///
- partial void GetAttrGeometryMultiPoint(ref DbGeometry result);
+ public DbGeometry AttrGeometryMultiLineString { get; set; }
///
/// Required
///
[Required]
- public DbGeometry AttrGeometryMultiPoint
- {
- get
- {
- DbGeometry value = _attrGeometryMultiPoint;
- GetAttrGeometryMultiPoint(ref value);
- return (_attrGeometryMultiPoint = value);
- }
- set
- {
- DbGeometry oldValue = _attrGeometryMultiPoint;
- SetAttrGeometryMultiPoint(oldValue, ref value);
- if (oldValue != value)
- {
- _attrGeometryMultiPoint = value;
- }
- }
- }
-
- ///
- /// Backing field for AttrGeometryMultiPolygon
- ///
- protected DbGeometry _attrGeometryMultiPolygon;
- ///
- /// When provided in a partial class, allows value of AttrGeometryMultiPolygon to be changed before setting.
- ///
- partial void SetAttrGeometryMultiPolygon(DbGeometry oldValue, ref DbGeometry newValue);
- ///
- /// When provided in a partial class, allows value of AttrGeometryMultiPolygon to be changed before returning.
- ///
- partial void GetAttrGeometryMultiPolygon(ref DbGeometry result);
+ public DbGeometry AttrGeometryMultiPoint { get; set; }
///
/// Required
///
[Required]
- public DbGeometry AttrGeometryMultiPolygon
- {
- get
- {
- DbGeometry value = _attrGeometryMultiPolygon;
- GetAttrGeometryMultiPolygon(ref value);
- return (_attrGeometryMultiPolygon = value);
- }
- set
- {
- DbGeometry oldValue = _attrGeometryMultiPolygon;
- SetAttrGeometryMultiPolygon(oldValue, ref value);
- if (oldValue != value)
- {
- _attrGeometryMultiPolygon = value;
- }
- }
- }
-
- ///
- /// Backing field for AttrGeometryPoint
- ///
- protected DbGeometry _attrGeometryPoint;
- ///
- /// When provided in a partial class, allows value of AttrGeometryPoint to be changed before setting.
- ///
- partial void SetAttrGeometryPoint(DbGeometry oldValue, ref DbGeometry newValue);
- ///
- /// When provided in a partial class, allows value of AttrGeometryPoint to be changed before returning.
- ///
- partial void GetAttrGeometryPoint(ref DbGeometry result);
+ public DbGeometry AttrGeometryMultiPolygon { get; set; }
///
/// Required
///
[Required]
- public DbGeometry AttrGeometryPoint
- {
- get
- {
- DbGeometry value = _attrGeometryPoint;
- GetAttrGeometryPoint(ref value);
- return (_attrGeometryPoint = value);
- }
- set
- {
- DbGeometry oldValue = _attrGeometryPoint;
- SetAttrGeometryPoint(oldValue, ref value);
- if (oldValue != value)
- {
- _attrGeometryPoint = value;
- }
- }
- }
+ public DbGeometry AttrGeometryPoint { get; set; }
}
}
diff --git a/src/Testing/EF6/EF6NetStandard/Generated/Entities/UChild.generated.cs b/src/Testing/EF6/EF6NetStandard/Generated/Entities/UChild.generated.cs
index a98e0cce7..82b05bbcb 100644
--- a/src/Testing/EF6/EF6NetStandard/Generated/Entities/UChild.generated.cs
+++ b/src/Testing/EF6/EF6NetStandard/Generated/Entities/UChild.generated.cs
@@ -58,7 +58,6 @@ public UChild(global::Testing.UParentRequired _uparentrequired1, global::Testing
if (_uparentrequired2 == null) throw new ArgumentNullException(nameof(_uparentrequired2));
_uparentrequired2.UChildOptional = this;
-
Init();
}
@@ -76,42 +75,12 @@ public static UChild Create(global::Testing.UParentRequired _uparentrequired1, g
* Properties
*************************************************************************/
- ///
- /// Backing field for Id
- ///
- internal int _id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
-
///
/// Identity, Indexed, Required
///
[Key]
[Required]
- public int Id
- {
- get
- {
- int value = _id;
- GetId(ref value);
- return (_id = value);
- }
- protected set
- {
- int oldValue = _id;
- SetId(oldValue, ref value);
- if (oldValue != value)
- {
- _id = value;
- }
- }
- }
+ public int Id { get; set; }
/*************************************************************************
* Navigation properties
diff --git a/src/Testing/EF6/EF6NetStandard/Generated/Entities/UParentCollection.generated.cs b/src/Testing/EF6/EF6NetStandard/Generated/Entities/UParentCollection.generated.cs
index 57e7d17e8..f2909654e 100644
--- a/src/Testing/EF6/EF6NetStandard/Generated/Entities/UParentCollection.generated.cs
+++ b/src/Testing/EF6/EF6NetStandard/Generated/Entities/UParentCollection.generated.cs
@@ -52,7 +52,6 @@ public UParentCollection(global::Testing.UChild uchildrequired)
this.UChildRequired = uchildrequired;
this.UChildCollection = new System.Collections.ObjectModel.ObservableCollection();
-
Init();
}
@@ -69,108 +68,25 @@ public static UParentCollection Create(global::Testing.UChild uchildrequired)
* Properties
*************************************************************************/
- ///
- /// Backing field for Id
- ///
- internal int _id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
-
///
/// Identity, Indexed, Required
///
[Key]
[Required]
- public int Id
- {
- get
- {
- int value = _id;
- GetId(ref value);
- return (_id = value);
- }
- protected set
- {
- int oldValue = _id;
- SetId(oldValue, ref value);
- if (oldValue != value)
- {
- _id = value;
- }
- }
- }
+ public int Id { get; set; }
/*************************************************************************
* Navigation properties
*************************************************************************/
- protected global::Testing.UChild _uChildRequired;
- partial void SetUChildRequired(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
- partial void GetUChildRequired(ref global::Testing.UChild result);
-
///
/// Required
///
- public virtual global::Testing.UChild UChildRequired
- {
- get
- {
- global::Testing.UChild value = _uChildRequired;
- GetUChildRequired(ref value);
- return (_uChildRequired = value);
- }
- set
- {
- global::Testing.UChild oldValue = _uChildRequired;
- SetUChildRequired(oldValue, ref value);
- if (oldValue != value)
- {
- _uChildRequired = value;
- }
- }
- }
+ public virtual global::Testing.UChild UChildRequired { get; set; }
- protected ICollection _uChildCollection;
- public virtual ICollection UChildCollection
- {
- get
- {
- return _uChildCollection;
- }
- private set
- {
- _uChildCollection = value;
- }
- }
-
- protected global::Testing.UChild _uChildOptional;
- partial void SetUChildOptional(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
- partial void GetUChildOptional(ref global::Testing.UChild result);
+ public virtual ICollection UChildCollection { get; private set; }
- public virtual global::Testing.UChild UChildOptional
- {
- get
- {
- global::Testing.UChild value = _uChildOptional;
- GetUChildOptional(ref value);
- return (_uChildOptional = value);
- }
- set
- {
- global::Testing.UChild oldValue = _uChildOptional;
- SetUChildOptional(oldValue, ref value);
- if (oldValue != value)
- {
- _uChildOptional = value;
- }
- }
- }
+ public virtual global::Testing.UChild UChildOptional { get; set; }
}
}
diff --git a/src/Testing/EF6/EF6NetStandard/Generated/Entities/UParentOptional.generated.cs b/src/Testing/EF6/EF6NetStandard/Generated/Entities/UParentOptional.generated.cs
index cdc50803b..467fa94de 100644
--- a/src/Testing/EF6/EF6NetStandard/Generated/Entities/UParentOptional.generated.cs
+++ b/src/Testing/EF6/EF6NetStandard/Generated/Entities/UParentOptional.generated.cs
@@ -22,7 +22,8 @@ namespace Testing
///
/// x
///
- public partial class UParentOptional: global::Testing.HiddenEntity, INotifyPropertyChanged
+ [System.ComponentModel.Description("x")]
+ public partial class UParentOptional: global::Testing.HiddenEntity
{
partial void Init();
@@ -57,7 +58,6 @@ public UParentOptional(global::Testing.UChild uchildrequired)
this.UChildRequired = uchildrequired;
this.UChildCollection = new System.Collections.ObjectModel.ObservableCollection();
-
Init();
}
@@ -74,119 +74,31 @@ public static UParentOptional Create(global::Testing.UChild uchildrequired)
* Properties
*************************************************************************/
- ///
- /// Backing field for PropertyInChild
- ///
- protected string _propertyInChild;
- ///
- /// When provided in a partial class, allows value of PropertyInChild to be changed before setting.
- ///
- partial void SetPropertyInChild(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of PropertyInChild to be changed before returning.
- ///
- 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);
- if (oldValue != value)
- {
- _propertyInChild = value;
- }
- }
- }
+ public string PropertyInChild { get; set; }
/*************************************************************************
* Navigation properties
*************************************************************************/
- protected global::Testing.UChild _uChildOptional;
- partial void SetUChildOptional(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
- partial void GetUChildOptional(ref global::Testing.UChild result);
-
///
/// x
///
- public virtual global::Testing.UChild UChildOptional
- {
- get
- {
- global::Testing.UChild value = _uChildOptional;
- GetUChildOptional(ref value);
- return (_uChildOptional = value);
- }
- set
- {
- global::Testing.UChild oldValue = _uChildOptional;
- SetUChildOptional(oldValue, ref value);
- if (oldValue != value)
- {
- _uChildOptional = value;
- }
- }
- }
+ [Description("x")]
+ public virtual global::Testing.UChild UChildOptional { get; set; }
- protected ICollection _uChildCollection;
///
/// h
///
- public virtual ICollection UChildCollection
- {
- get
- {
- return _uChildCollection;
- }
- private set
- {
- _uChildCollection = value;
- }
- }
-
- protected global::Testing.UChild _uChildRequired;
- partial void SetUChildRequired(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
- partial void GetUChildRequired(ref global::Testing.UChild result);
+ [Description("h")]
+ public virtual ICollection UChildCollection { get; private set; }
///
/// Required
///
- public virtual global::Testing.UChild UChildRequired
- {
- get
- {
- global::Testing.UChild value = _uChildRequired;
- GetUChildRequired(ref value);
- return (_uChildRequired = value);
- }
- set
- {
- global::Testing.UChild oldValue = _uChildRequired;
- SetUChildRequired(oldValue, ref value);
- if (oldValue != value)
- {
- _uChildRequired = value;
- }
- }
- }
-
- public virtual event PropertyChangedEventHandler PropertyChanged;
-
- protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
- }
+ public virtual global::Testing.UChild UChildRequired { get; set; }
}
}
diff --git a/src/Testing/EF6/EF6NetStandard/Generated/Entities/UParentRequired.generated.cs b/src/Testing/EF6/EF6NetStandard/Generated/Entities/UParentRequired.generated.cs
index 304681e19..77d69ed1c 100644
--- a/src/Testing/EF6/EF6NetStandard/Generated/Entities/UParentRequired.generated.cs
+++ b/src/Testing/EF6/EF6NetStandard/Generated/Entities/UParentRequired.generated.cs
@@ -38,108 +38,25 @@ public UParentRequired()
* Properties
*************************************************************************/
- ///
- /// Backing field for Id
- ///
- internal int _id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
-
///
/// Identity, Indexed, Required
///
[Key]
[Required]
- public int Id
- {
- get
- {
- int value = _id;
- GetId(ref value);
- return (_id = value);
- }
- protected set
- {
- int oldValue = _id;
- SetId(oldValue, ref value);
- if (oldValue != value)
- {
- _id = value;
- }
- }
- }
+ public int Id { get; set; }
/*************************************************************************
* Navigation properties
*************************************************************************/
- protected global::Testing.UChild _uChildRequired;
- partial void SetUChildRequired(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
- partial void GetUChildRequired(ref global::Testing.UChild result);
-
///
/// Required
///
- public virtual global::Testing.UChild UChildRequired
- {
- get
- {
- global::Testing.UChild value = _uChildRequired;
- GetUChildRequired(ref value);
- return (_uChildRequired = value);
- }
- set
- {
- global::Testing.UChild oldValue = _uChildRequired;
- SetUChildRequired(oldValue, ref value);
- if (oldValue != value)
- {
- _uChildRequired = value;
- }
- }
- }
-
- protected ICollection _uChildCollection;
- public virtual ICollection UChildCollection
- {
- get
- {
- return _uChildCollection;
- }
- private set
- {
- _uChildCollection = value;
- }
- }
+ public virtual global::Testing.UChild UChildRequired { get; set; }
- protected global::Testing.UChild _uChildOptional;
- partial void SetUChildOptional(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
- partial void GetUChildOptional(ref global::Testing.UChild result);
+ public virtual ICollection UChildCollection { get; private set; }
- public virtual global::Testing.UChild UChildOptional
- {
- get
- {
- global::Testing.UChild value = _uChildOptional;
- GetUChildOptional(ref value);
- return (_uChildOptional = value);
- }
- set
- {
- global::Testing.UChild oldValue = _uChildOptional;
- SetUChildOptional(oldValue, ref value);
- if (oldValue != value)
- {
- _uChildOptional = value;
- }
- }
- }
+ public virtual global::Testing.UChild UChildOptional { get; set; }
}
}
diff --git a/src/Testing/EFCoreV2/EFCore2NetCore2/AllFeatureModel.cs b/src/Testing/EFCoreV2/EFCore2NetCore2/AllFeatureModel.cs
index 6153a7d78..47021ebc9 100644
--- a/src/Testing/EFCoreV2/EFCore2NetCore2/AllFeatureModel.cs
+++ b/src/Testing/EFCoreV2/EFCore2NetCore2/AllFeatureModel.cs
@@ -1 +1,1851 @@
+//------------------------------------------------------------------------------
+//
+// 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
+ {
+ partial void Init();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected AllPropertyTypesRequired()
+ {
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static AllPropertyTypesRequired CreateAllPropertyTypesRequiredUnsafe()
+ {
+ return new AllPropertyTypesRequired();
+ }
+
+ ///
+ /// 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)
+ {
+ this.BinaryAttr = binaryattr;
+
+ this.BooleanAttr = booleanattr;
+
+ this.ByteAttr = byteattr;
+
+ this.DateTimeAttr = datetimeattr;
+
+ this.DateTimeOffsetAttr = datetimeoffsetattr;
+
+ this.DecimalAttr = decimalattr;
+
+ this.DoubleAttr = doubleattr;
+
+ this.GuidAttr = guidattr;
+
+ this.Int16Attr = int16attr;
+
+ this.Int32Attr = int32attr;
+
+ this.Int64Attr = int64attr;
+
+ this.SingleAttr = singleattr;
+
+ if (string.IsNullOrEmpty(stringattr)) throw new ArgumentNullException(nameof(stringattr));
+ this.StringAttr = stringattr;
+
+ this.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);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for Id
+ ///
+ internal int _id;
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ ///
+ partial void SetId(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ ///
+ partial void GetId(ref int result);
+
+ ///
+ /// Identity, Indexed, Required
+ ///
+ [Key]
+ [Required]
+ public int Id
+ {
+ get
+ {
+ int value = _id;
+ GetId(ref value);
+ return (_id = value);
+ }
+ set
+ {
+ int oldValue = _id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _id = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for BinaryAttr
+ ///
+ protected byte[] _binaryAttr;
+ ///
+ /// When provided in a partial class, allows value of BinaryAttr to be changed before setting.
+ ///
+ partial void SetBinaryAttr(byte[] oldValue, ref byte[] newValue);
+ ///
+ /// When provided in a partial class, allows value of BinaryAttr to be changed before returning.
+ ///
+ partial void GetBinaryAttr(ref byte[] result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public byte[] BinaryAttr
+ {
+ get
+ {
+ byte[] value = _binaryAttr;
+ GetBinaryAttr(ref value);
+ return (_binaryAttr = value);
+ }
+ set
+ {
+ byte[] oldValue = _binaryAttr;
+ SetBinaryAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _binaryAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for BooleanAttr
+ ///
+ protected bool _booleanAttr;
+ ///
+ /// When provided in a partial class, allows value of BooleanAttr to be changed before setting.
+ ///
+ partial void SetBooleanAttr(bool oldValue, ref bool newValue);
+ ///
+ /// When provided in a partial class, allows value of BooleanAttr to be changed before returning.
+ ///
+ partial void GetBooleanAttr(ref bool result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public bool BooleanAttr
+ {
+ get
+ {
+ bool value = _booleanAttr;
+ GetBooleanAttr(ref value);
+ return (_booleanAttr = value);
+ }
+ set
+ {
+ bool oldValue = _booleanAttr;
+ SetBooleanAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _booleanAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for ByteAttr
+ ///
+ protected byte _byteAttr;
+ ///
+ /// When provided in a partial class, allows value of ByteAttr to be changed before setting.
+ ///
+ partial void SetByteAttr(byte oldValue, ref byte newValue);
+ ///
+ /// When provided in a partial class, allows value of ByteAttr to be changed before returning.
+ ///
+ partial void GetByteAttr(ref byte result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public byte ByteAttr
+ {
+ get
+ {
+ byte value = _byteAttr;
+ GetByteAttr(ref value);
+ return (_byteAttr = value);
+ }
+ set
+ {
+ byte oldValue = _byteAttr;
+ SetByteAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _byteAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for DateTimeAttr
+ ///
+ protected DateTime _dateTimeAttr;
+ ///
+ /// When provided in a partial class, allows value of DateTimeAttr to be changed before setting.
+ ///
+ partial void SetDateTimeAttr(DateTime oldValue, ref DateTime newValue);
+ ///
+ /// When provided in a partial class, allows value of DateTimeAttr to be changed before returning.
+ ///
+ partial void GetDateTimeAttr(ref DateTime result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public DateTime DateTimeAttr
+ {
+ get
+ {
+ DateTime value = _dateTimeAttr;
+ GetDateTimeAttr(ref value);
+ return (_dateTimeAttr = value);
+ }
+ set
+ {
+ DateTime oldValue = _dateTimeAttr;
+ SetDateTimeAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _dateTimeAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for DateTimeOffsetAttr
+ ///
+ protected DateTimeOffset _dateTimeOffsetAttr;
+ ///
+ /// When provided in a partial class, allows value of DateTimeOffsetAttr to be changed before setting.
+ ///
+ partial void SetDateTimeOffsetAttr(DateTimeOffset oldValue, ref DateTimeOffset newValue);
+ ///
+ /// When provided in a partial class, allows value of DateTimeOffsetAttr to be changed before returning.
+ ///
+ partial void GetDateTimeOffsetAttr(ref DateTimeOffset result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public DateTimeOffset DateTimeOffsetAttr
+ {
+ get
+ {
+ DateTimeOffset value = _dateTimeOffsetAttr;
+ GetDateTimeOffsetAttr(ref value);
+ return (_dateTimeOffsetAttr = value);
+ }
+ set
+ {
+ DateTimeOffset oldValue = _dateTimeOffsetAttr;
+ SetDateTimeOffsetAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _dateTimeOffsetAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for DecimalAttr
+ ///
+ protected decimal _decimalAttr;
+ ///
+ /// When provided in a partial class, allows value of DecimalAttr to be changed before setting.
+ ///
+ partial void SetDecimalAttr(decimal oldValue, ref decimal newValue);
+ ///
+ /// When provided in a partial class, allows value of DecimalAttr to be changed before returning.
+ ///
+ partial void GetDecimalAttr(ref decimal result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public decimal DecimalAttr
+ {
+ get
+ {
+ decimal value = _decimalAttr;
+ GetDecimalAttr(ref value);
+ return (_decimalAttr = value);
+ }
+ set
+ {
+ decimal oldValue = _decimalAttr;
+ SetDecimalAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _decimalAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for DoubleAttr
+ ///
+ protected double _doubleAttr;
+ ///
+ /// When provided in a partial class, allows value of DoubleAttr to be changed before setting.
+ ///
+ partial void SetDoubleAttr(double oldValue, ref double newValue);
+ ///
+ /// When provided in a partial class, allows value of DoubleAttr to be changed before returning.
+ ///
+ partial void GetDoubleAttr(ref double result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public double DoubleAttr
+ {
+ get
+ {
+ double value = _doubleAttr;
+ GetDoubleAttr(ref value);
+ return (_doubleAttr = value);
+ }
+ set
+ {
+ double oldValue = _doubleAttr;
+ SetDoubleAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _doubleAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for GuidAttr
+ ///
+ protected Guid _guidAttr;
+ ///
+ /// When provided in a partial class, allows value of GuidAttr to be changed before setting.
+ ///
+ partial void SetGuidAttr(Guid oldValue, ref Guid newValue);
+ ///
+ /// When provided in a partial class, allows value of GuidAttr to be changed before returning.
+ ///
+ partial void GetGuidAttr(ref Guid result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public Guid GuidAttr
+ {
+ get
+ {
+ Guid value = _guidAttr;
+ GetGuidAttr(ref value);
+ return (_guidAttr = value);
+ }
+ set
+ {
+ Guid oldValue = _guidAttr;
+ SetGuidAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _guidAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for Int16Attr
+ ///
+ protected short _int16Attr;
+ ///
+ /// When provided in a partial class, allows value of Int16Attr to be changed before setting.
+ ///
+ partial void SetInt16Attr(short oldValue, ref short newValue);
+ ///
+ /// When provided in a partial class, allows value of Int16Attr to be changed before returning.
+ ///
+ partial void GetInt16Attr(ref short result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public short Int16Attr
+ {
+ get
+ {
+ short value = _int16Attr;
+ GetInt16Attr(ref value);
+ return (_int16Attr = value);
+ }
+ set
+ {
+ short oldValue = _int16Attr;
+ SetInt16Attr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _int16Attr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for Int32Attr
+ ///
+ protected int _int32Attr;
+ ///
+ /// When provided in a partial class, allows value of Int32Attr to be changed before setting.
+ ///
+ partial void SetInt32Attr(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Int32Attr to be changed before returning.
+ ///
+ partial void GetInt32Attr(ref int result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public int Int32Attr
+ {
+ get
+ {
+ int value = _int32Attr;
+ GetInt32Attr(ref value);
+ return (_int32Attr = value);
+ }
+ set
+ {
+ int oldValue = _int32Attr;
+ SetInt32Attr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _int32Attr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for Int64Attr
+ ///
+ protected long _int64Attr;
+ ///
+ /// When provided in a partial class, allows value of Int64Attr to be changed before setting.
+ ///
+ partial void SetInt64Attr(long oldValue, ref long newValue);
+ ///
+ /// When provided in a partial class, allows value of Int64Attr to be changed before returning.
+ ///
+ partial void GetInt64Attr(ref long result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public long Int64Attr
+ {
+ get
+ {
+ long value = _int64Attr;
+ GetInt64Attr(ref value);
+ return (_int64Attr = value);
+ }
+ set
+ {
+ long oldValue = _int64Attr;
+ SetInt64Attr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _int64Attr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for SingleAttr
+ ///
+ protected Single _singleAttr;
+ ///
+ /// When provided in a partial class, allows value of SingleAttr to be changed before setting.
+ ///
+ partial void SetSingleAttr(Single oldValue, ref Single newValue);
+ ///
+ /// When provided in a partial class, allows value of SingleAttr to be changed before returning.
+ ///
+ partial void GetSingleAttr(ref Single result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public Single SingleAttr
+ {
+ get
+ {
+ Single value = _singleAttr;
+ GetSingleAttr(ref value);
+ return (_singleAttr = value);
+ }
+ set
+ {
+ Single oldValue = _singleAttr;
+ SetSingleAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _singleAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for StringAttr
+ ///
+ protected string _stringAttr;
+ ///
+ /// When provided in a partial class, allows value of StringAttr to be changed before setting.
+ ///
+ partial void SetStringAttr(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of StringAttr to be changed before returning.
+ ///
+ partial void GetStringAttr(ref string result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public string StringAttr
+ {
+ get
+ {
+ string value = _stringAttr;
+ GetStringAttr(ref value);
+ return (_stringAttr = value);
+ }
+ set
+ {
+ string oldValue = _stringAttr;
+ SetStringAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _stringAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for TimeAttr
+ ///
+ protected TimeSpan _timeAttr;
+ ///
+ /// When provided in a partial class, allows value of TimeAttr to be changed before setting.
+ ///
+ partial void SetTimeAttr(TimeSpan oldValue, ref TimeSpan newValue);
+ ///
+ /// When provided in a partial class, allows value of TimeAttr to be changed before returning.
+ ///
+ partial void GetTimeAttr(ref TimeSpan result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public TimeSpan TimeAttr
+ {
+ get
+ {
+ TimeSpan value = _timeAttr;
+ GetTimeAttr(ref value);
+ return (_timeAttr = value);
+ }
+ set
+ {
+ TimeSpan oldValue = _timeAttr;
+ SetTimeAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _timeAttr = value;
+ }
+ }
+ }
+
+ }
+}
+
+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
+ {
+ partial void Init();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected AllPropertyTypesOptional()
+ {
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static AllPropertyTypesOptional CreateAllPropertyTypesOptionalUnsafe()
+ {
+ return new AllPropertyTypesOptional();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
+ ///
+ public AllPropertyTypesOptional(int id1)
+ {
+ this.Id1 = id1;
+
+ this.OwnedType = new global::Testing.OwnedType();
+ Init();
+ }
+
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ ///
+ public static AllPropertyTypesOptional Create(int id1)
+ {
+ return new AllPropertyTypesOptional(id1);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for Id
+ ///
+ internal int _id;
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ ///
+ partial void SetId(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ ///
+ partial void GetId(ref int result);
+
+ ///
+ /// Identity, Indexed, Required
+ ///
+ [Key]
+ [Required]
+ public int Id
+ {
+ get
+ {
+ int value = _id;
+ GetId(ref value);
+ return (_id = value);
+ }
+ set
+ {
+ int oldValue = _id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _id = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for BinaryAttr
+ ///
+ protected byte[] _binaryAttr;
+ ///
+ /// When provided in a partial class, allows value of BinaryAttr to be changed before setting.
+ ///
+ partial void SetBinaryAttr(byte[] oldValue, ref byte[] newValue);
+ ///
+ /// When provided in a partial class, allows value of BinaryAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _binaryAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for BooleanAttr
+ ///
+ protected bool? _booleanAttr;
+ ///
+ /// When provided in a partial class, allows value of BooleanAttr to be changed before setting.
+ ///
+ partial void SetBooleanAttr(bool? oldValue, ref bool? newValue);
+ ///
+ /// When provided in a partial class, allows value of BooleanAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _booleanAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for ByteAttr
+ ///
+ protected byte? _byteAttr;
+ ///
+ /// When provided in a partial class, allows value of ByteAttr to be changed before setting.
+ ///
+ partial void SetByteAttr(byte? oldValue, ref byte? newValue);
+ ///
+ /// When provided in a partial class, allows value of ByteAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _byteAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for DateTimeAttr
+ ///
+ protected DateTime? _dateTimeAttr;
+ ///
+ /// When provided in a partial class, allows value of DateTimeAttr to be changed before setting.
+ ///
+ partial void SetDateTimeAttr(DateTime? oldValue, ref DateTime? newValue);
+ ///
+ /// When provided in a partial class, allows value of DateTimeAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _dateTimeAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for DateTimeOffsetAttr
+ ///
+ protected DateTimeOffset? _dateTimeOffsetAttr;
+ ///
+ /// When provided in a partial class, allows value of DateTimeOffsetAttr to be changed before setting.
+ ///
+ partial void SetDateTimeOffsetAttr(DateTimeOffset? oldValue, ref DateTimeOffset? newValue);
+ ///
+ /// When provided in a partial class, allows value of DateTimeOffsetAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _dateTimeOffsetAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for DecimalAttr
+ ///
+ protected decimal? _decimalAttr;
+ ///
+ /// When provided in a partial class, allows value of DecimalAttr to be changed before setting.
+ ///
+ partial void SetDecimalAttr(decimal? oldValue, ref decimal? newValue);
+ ///
+ /// When provided in a partial class, allows value of DecimalAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _decimalAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for DoubleAttr
+ ///
+ protected double? _doubleAttr;
+ ///
+ /// When provided in a partial class, allows value of DoubleAttr to be changed before setting.
+ ///
+ partial void SetDoubleAttr(double? oldValue, ref double? newValue);
+ ///
+ /// When provided in a partial class, allows value of DoubleAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _doubleAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for GuidAttr
+ ///
+ protected Guid? _guidAttr;
+ ///
+ /// When provided in a partial class, allows value of GuidAttr to be changed before setting.
+ ///
+ partial void SetGuidAttr(Guid? oldValue, ref Guid? newValue);
+ ///
+ /// When provided in a partial class, allows value of GuidAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _guidAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for Int16Attr
+ ///
+ protected short? _int16Attr;
+ ///
+ /// When provided in a partial class, allows value of Int16Attr to be changed before setting.
+ ///
+ partial void SetInt16Attr(short? oldValue, ref short? newValue);
+ ///
+ /// When provided in a partial class, allows value of Int16Attr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _int16Attr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for Int32Attr
+ ///
+ protected int? _int32Attr;
+ ///
+ /// When provided in a partial class, allows value of Int32Attr to be changed before setting.
+ ///
+ partial void SetInt32Attr(int? oldValue, ref int? newValue);
+ ///
+ /// When provided in a partial class, allows value of Int32Attr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _int32Attr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for Int64Attr
+ ///
+ protected long? _int64Attr;
+ ///
+ /// When provided in a partial class, allows value of Int64Attr to be changed before setting.
+ ///
+ partial void SetInt64Attr(long? oldValue, ref long? newValue);
+ ///
+ /// When provided in a partial class, allows value of Int64Attr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _int64Attr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for SingleAttr
+ ///
+ protected Single? _singleAttr;
+ ///
+ /// When provided in a partial class, allows value of SingleAttr to be changed before setting.
+ ///
+ partial void SetSingleAttr(Single? oldValue, ref Single? newValue);
+ ///
+ /// When provided in a partial class, allows value of SingleAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _singleAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for StringAttr
+ ///
+ protected string _stringAttr;
+ ///
+ /// When provided in a partial class, allows value of StringAttr to be changed before setting.
+ ///
+ partial void SetStringAttr(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of StringAttr to be changed before returning.
+ ///
+ partial void GetStringAttr(ref string result);
+
+ public string StringAttr
+ {
+ get
+ {
+ string value = _stringAttr;
+ GetStringAttr(ref value);
+ return (_stringAttr = value);
+ }
+ set
+ {
+ string oldValue = _stringAttr;
+ SetStringAttr(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _stringAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for TimeAttr
+ ///
+ protected TimeSpan? _timeAttr;
+ ///
+ /// When provided in a partial class, allows value of TimeAttr to be changed before setting.
+ ///
+ partial void SetTimeAttr(TimeSpan? oldValue, ref TimeSpan? newValue);
+ ///
+ /// When provided in a partial class, allows value of TimeAttr to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _timeAttr = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for Id1
+ ///
+ internal int _id1;
+ ///
+ /// When provided in a partial class, allows value of Id1 to be changed before setting.
+ ///
+ partial void SetId1(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Id1 to be changed before returning.
+ ///
+ partial void GetId1(ref int result);
+
+ ///
+ /// Identity, Indexed, Required
+ ///
+ [Key]
+ [Required]
+ public int Id1
+ {
+ get
+ {
+ int value = _id1;
+ GetId1(ref value);
+ return (_id1 = value);
+ }
+ set
+ {
+ int oldValue = _id1;
+ SetId1(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _id1 = value;
+ }
+ }
+ }
+
+ ///
+ /// Concurrency token
+ ///
+ [Timestamp]
+ public Byte[] Timestamp { get; set; }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for OwnedType
+ ///
+ protected global::Testing.OwnedType _ownedType;
+
+ ///
+ /// When provided in a partial class, allows value of OwnedType to be changed before setting.
+ ///
+ partial void SetOwnedType(global::Testing.OwnedType oldValue, ref global::Testing.OwnedType newValue);
+
+ ///
+ /// When provided in a partial class, allows value of OwnedType to be changed before returning.
+ ///
+ partial void GetOwnedType(ref global::Testing.OwnedType result);
+
+ public virtual global::Testing.OwnedType OwnedType
+ {
+ get
+ {
+ global::Testing.OwnedType value = _ownedType;
+ GetOwnedType(ref value);
+ return (_ownedType = value);
+ }
+ set
+ {
+ global::Testing.OwnedType oldValue = _ownedType;
+ SetOwnedType(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _ownedType = value;
+ }
+ }
+ }
+
+ }
+}
+
+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
+ {
+ partial void Init();
+
+ ///
+ /// Default constructor
+ ///
+ public UParentRequired()
+ {
+ UChildCollection = new System.Collections.Generic.HashSet();
+ UChildRequired = global::Testing.UChild.CreateUChildUnsafe();
+
+ Init();
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for Id
+ ///
+ internal int _id;
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ ///
+ partial void SetId(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ ///
+ partial void GetId(ref int result);
+
+ ///
+ /// Identity, Indexed, Required
+ ///
+ [Key]
+ [Required]
+ public int Id
+ {
+ get
+ {
+ int value = _id;
+ GetId(ref value);
+ return (_id = value);
+ }
+ set
+ {
+ int oldValue = _id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _id = value;
+ }
+ }
+ }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for UChildRequired
+ ///
+ protected global::Testing.UChild _uChildRequired;
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before setting.
+ ///
+ partial void SetUChildRequired(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before returning.
+ ///
+ partial void GetUChildRequired(ref global::Testing.UChild result);
+
+ ///
+ /// Required
+ ///
+ public virtual global::Testing.UChild UChildRequired
+ {
+ get
+ {
+ global::Testing.UChild value = _uChildRequired;
+ GetUChildRequired(ref value);
+ return (_uChildRequired = value);
+ }
+ set
+ {
+ global::Testing.UChild oldValue = _uChildRequired;
+ SetUChildRequired(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _uChildRequired = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for UChildCollection
+ ///
+ protected ICollection _uChildCollection;
+
+ public virtual ICollection UChildCollection
+ {
+ get
+ {
+ return _uChildCollection;
+ }
+ private set
+ {
+ _uChildCollection = value;
+ }
+ }
+
+ ///
+ /// Backing field for UChildOptional
+ ///
+ protected global::Testing.UChild _uChildOptional;
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before setting.
+ ///
+ partial void SetUChildOptional(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before returning.
+ ///
+ partial void GetUChildOptional(ref global::Testing.UChild result);
+
+ public virtual global::Testing.UChild UChildOptional
+ {
+ get
+ {
+ global::Testing.UChild value = _uChildOptional;
+ GetUChildOptional(ref value);
+ return (_uChildOptional = value);
+ }
+ set
+ {
+ global::Testing.UChild oldValue = _uChildOptional;
+ SetUChildOptional(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _uChildOptional = value;
+ }
+ }
+ }
+
+ }
+}
+
+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: global::Testing.HiddenEntity
+ {
+ 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();
+ UChildRequired = global::Testing.UChild.CreateUChildUnsafe();
+
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static UParentOptional CreateUParentOptionalUnsafe()
+ {
+ return new UParentOptional();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
+ ///
+ public UParentOptional(global::Testing.UChild uchildrequired)
+ {
+ this.PropertyInChild = "hello";
+ if (uchildrequired == null) throw new ArgumentNullException(nameof(uchildrequired));
+ this.UChildRequired = uchildrequired;
+
+ this.UChildCollection = new System.Collections.Generic.HashSet();
+ Init();
+ }
+
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ ///
+ public static UParentOptional Create(global::Testing.UChild uchildrequired)
+ {
+ return new UParentOptional(uchildrequired);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for PropertyInChild
+ ///
+ protected string _propertyInChild;
+ ///
+ /// When provided in a partial class, allows value of PropertyInChild to be changed before setting.
+ ///
+ partial void SetPropertyInChild(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of PropertyInChild to be changed before returning.
+ ///
+ 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);
+ if (oldValue != value)
+ {
+ _propertyInChild = value;
+ }
+ }
+ }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for UChildOptional
+ ///
+ protected global::Testing.UChild _uChildOptional;
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before setting.
+ ///
+ partial void SetUChildOptional(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before returning.
+ ///
+ partial void GetUChildOptional(ref global::Testing.UChild result);
+
+ public virtual global::Testing.UChild UChildOptional
+ {
+ get
+ {
+ global::Testing.UChild value = _uChildOptional;
+ GetUChildOptional(ref value);
+ return (_uChildOptional = value);
+ }
+ set
+ {
+ global::Testing.UChild oldValue = _uChildOptional;
+ SetUChildOptional(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _uChildOptional = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for UChildCollection
+ ///
+ protected ICollection _uChildCollection;
+
+ public virtual ICollection UChildCollection
+ {
+ get
+ {
+ return _uChildCollection;
+ }
+ private set
+ {
+ _uChildCollection = value;
+ }
+ }
+
+ ///
+ /// Backing field for UChildRequired
+ ///
+ protected global::Testing.UChild _uChildRequired;
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before setting.
+ ///
+ partial void SetUChildRequired(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before returning.
+ ///
+ partial void GetUChildRequired(ref global::Testing.UChild result);
+
+ ///
+ /// Required
+ ///
+ public virtual global::Testing.UChild UChildRequired
+ {
+ get
+ {
+ global::Testing.UChild value = _uChildRequired;
+ GetUChildRequired(ref value);
+ return (_uChildRequired = value);
+ }
+ set
+ {
+ global::Testing.UChild oldValue = _uChildRequired;
+ SetUChildRequired(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _uChildRequired = value;
+ }
+ }
+ }
+
+ }
+}
+
+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
+ {
+ partial void Init();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected UParentCollection()
+ {
+ UChildRequired = global::Testing.UChild.CreateUChildUnsafe();
+
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static UParentCollection CreateUParentCollectionUnsafe()
+ {
+ return new UParentCollection();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
+ ///
+ public UParentCollection(global::Testing.UChild uchildrequired)
+ {
+ if (uchildrequired == null) throw new ArgumentNullException(nameof(uchildrequired));
+ this.UChildRequired = uchildrequired;
+
+ Init();
+ }
+
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ ///
+ public static UParentCollection Create(global::Testing.UChild uchildrequired)
+ {
+ return new UParentCollection(uchildrequired);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for Id
+ ///
+ internal int _id;
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ ///
+ partial void SetId(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ ///
+ partial void GetId(ref int result);
+
+ ///
+ /// Identity, Indexed, Required
+ ///
+ [Key]
+ [Required]
+ public int Id
+ {
+ get
+ {
+ int value = _id;
+ GetId(ref value);
+ return (_id = value);
+ }
+ set
+ {
+ int oldValue = _id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _id = value;
+ }
+ }
+ }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for UChildRequired
+ ///
+ protected global::Testing.UChild _uChildRequired;
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before setting.
+ ///
+ partial void SetUChildRequired(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildRequired to be changed before returning.
+ ///
+ partial void GetUChildRequired(ref global::Testing.UChild result);
+
+ ///
+ /// Required
+ ///
+ public virtual global::Testing.UChild UChildRequired
+ {
+ get
+ {
+ global::Testing.UChild value = _uChildRequired;
+ GetUChildRequired(ref value);
+ return (_uChildRequired = value);
+ }
+ set
+ {
+ global::Testing.UChild oldValue = _uChildRequired;
+ SetUChildRequired(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _uChildRequired = value;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for UChildOptional
+ ///
+ protected global::Testing.UChild _uChildOptional;
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before setting.
+ ///
+ partial void SetUChildOptional(global::Testing.UChild oldValue, ref global::Testing.UChild newValue);
+
+ ///
+ /// When provided in a partial class, allows value of UChildOptional to be changed before returning.
+ ///
+ partial void GetUChildOptional(ref global::Testing.UChild result);
+
+ public virtual global::Testing.UChild UChildOptional
+ {
+ get
+ {
+ global::Testing.UChild value = _uChildOptional;
+ GetUChildOptional(ref value);
+ return (_uChildOptional = value);
+ }
+ set
+ {
+ global::Testing.UChild oldValue = _uChildOptional;
+ SetUChildOptional(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _uChildOptional = value;
+ }
+ }
+ }
+
+ }
+}
+
+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
+ {
+ partial void Init();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected UChild()
+ {
+ // NOTE: This class has one-to-one associations with UChild.
+ // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
+
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static UChild CreateUChildUnsafe()
+ {
+ return new UChild();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
diff --git a/src/Testing/EFCoreV2/EFCore2NetCore2/Generated/Context/AllFeatureModel.generated.cs b/src/Testing/EFCoreV2/EFCore2NetCore2/Generated/Context/AllFeatureModel.generated.cs
index 8b4ef3701..b58a5a1b4 100644
--- a/src/Testing/EFCoreV2/EFCore2NetCore2/Generated/Context/AllFeatureModel.generated.cs
+++ b/src/Testing/EFCoreV2/EFCore2NetCore2/Generated/Context/AllFeatureModel.generated.cs
@@ -76,7 +76,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
modelBuilder.Entity().ToTable("AllPropertyTypesOptionals").HasKey(t => new { t.Id, t.Id1 });
- modelBuilder.Entity().Property(t => t.Id).IsRequired().HasField("_id").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction).ValueGeneratedOnAdd();
+ modelBuilder.Entity().Property(t => t.Id).HasField("_id").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction).ValueGeneratedOnAdd().IsRequired();
modelBuilder.Entity().Property(t => t.BinaryAttr).HasField("_binaryAttr").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction);
modelBuilder.Entity().Property(t => t.BooleanAttr).HasField("_booleanAttr").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction);
modelBuilder.Entity().Property(t => t.ByteAttr).HasField("_byteAttr").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction);
@@ -91,76 +91,76 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
modelBuilder.Entity().Property(t => t.SingleAttr).HasField("_singleAttr").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction);
modelBuilder.Entity().Property(t => t.StringAttr).HasField("_stringAttr").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction);
modelBuilder.Entity().Property(t => t.TimeAttr).HasField("_timeAttr").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction);
- modelBuilder.Entity().Property(t => t.Id1).IsRequired().HasField("_id1").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction).ValueGeneratedNever();
+ modelBuilder.Entity().Property(t => t.Id1).HasField("_id1").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction).ValueGeneratedNever().IsRequired();
modelBuilder.Entity().Property("Timestamp").IsConcurrencyToken();
modelBuilder.Entity().OwnsOne(p => p.OwnedType).Property(p => p.SingleAttr);
modelBuilder.Entity().ToTable("AllPropertyTypesRequireds").HasKey(t => t.Id);
- modelBuilder.Entity().Property(t => t.Id).IsRequired().HasField("_id").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction).ValueGeneratedOnAdd();
- modelBuilder.Entity().Property(t => t.BinaryAttr).IsRequired().HasField("_binaryAttr").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction);
- modelBuilder.Entity().Property(t => t.BooleanAttr).IsRequired().HasField("_booleanAttr").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction);
- modelBuilder.Entity().Property(t => t.ByteAttr).IsRequired().HasField("_byteAttr").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction);
- modelBuilder.Entity().Property(t => t.DateTimeAttr).IsRequired().HasField("_dateTimeAttr").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction);
- modelBuilder.Entity().Property(t => t.DateTimeOffsetAttr).IsRequired().HasField("_dateTimeOffsetAttr").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction);
- modelBuilder.Entity().Property(t => t.DecimalAttr).IsRequired().HasField("_decimalAttr").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction);
- modelBuilder.Entity().Property(t => t.DoubleAttr).IsRequired().HasField("_doubleAttr").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction);
- modelBuilder.Entity().Property(t => t.GuidAttr).IsRequired().HasField("_guidAttr").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction);
- modelBuilder.Entity().Property(t => t.Int16Attr).IsRequired().HasField("_int16Attr").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction);
- modelBuilder.Entity().Property(t => t.Int32Attr).IsRequired().HasField("_int32Attr").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction);
- modelBuilder.Entity().Property(t => t.Int64Attr).IsRequired().HasField("_int64Attr").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction);
- modelBuilder.Entity().Property(t => t.SingleAttr).IsRequired().HasField("_singleAttr").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction);
- modelBuilder.Entity().Property(t => t.StringAttr).IsRequired().HasField("_stringAttr").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction);
- modelBuilder.Entity().Property(t => t.TimeAttr).IsRequired().HasField("_timeAttr").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction);
+ modelBuilder.Entity().Property(t => t.Id).HasField("_id").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction).ValueGeneratedOnAdd().IsRequired();
+ modelBuilder.Entity().Property(t => t.BinaryAttr).HasField("_binaryAttr").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction).IsRequired();
+ modelBuilder.Entity().Property(t => t.BooleanAttr).HasField("_booleanAttr").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction).IsRequired();
+ modelBuilder.Entity().Property(t => t.ByteAttr).HasField("_byteAttr").UsePropertyAccessMode(PropertyAccessMode.FieldDuringConstruction).IsRequired();
+ modelBuilder.Entity