diff --git a/src/OpenRiaServices.Client/Framework/ChangeSetBuilder.cs b/src/OpenRiaServices.Client/Framework/ChangeSetBuilder.cs
index 123c0cc4b..770ea72ed 100644
--- a/src/OpenRiaServices.Client/Framework/ChangeSetBuilder.cs
+++ b/src/OpenRiaServices.Client/Framework/ChangeSetBuilder.cs
@@ -368,7 +368,7 @@ protected override void VisitEntityCollection(IEntityCollection entityCollection
///
/// The association to check.
/// The resulting collection of entries.
- private IEnumerable FindOriginalChildren(AssociationAttribute association)
+ private IEnumerable FindOriginalChildren(EntityAssociationAttribute association)
{
foreach (ChangeSetEntry entry in this._changeSetEntries.Where(p => p.Entity.EntityState == EntityState.Deleted))
{
@@ -467,7 +467,7 @@ protected override void VisitEntityCollection(IEntityCollection entityCollection
// look for any invalid updates made to composed children
if (entityCollection.HasValues && member.IsComposition)
{
- AssociationAttribute assoc = member.AssociationAttribute;
+ EntityAssociationAttribute assoc = member.AssociationAttribute;
foreach (Entity childEntity in entityCollection.Entities)
{
CheckInvalidChildUpdates(childEntity, assoc);
@@ -498,7 +498,7 @@ protected override void VisitEntityRef(IEntityRef entityRef, Entity parent, Meta
///
/// The child entity to check.
/// The composition attribute.
- private static void CheckInvalidChildUpdates(Entity entity, AssociationAttribute compositionAttribute)
+ private static void CheckInvalidChildUpdates(Entity entity, EntityAssociationAttribute compositionAttribute)
{
if (compositionAttribute == null)
{
diff --git a/src/OpenRiaServices.Client/Framework/Entity.cs b/src/OpenRiaServices.Client/Framework/Entity.cs
index ac9a8933c..ea7f4195e 100644
--- a/src/OpenRiaServices.Client/Framework/Entity.cs
+++ b/src/OpenRiaServices.Client/Framework/Entity.cs
@@ -38,7 +38,7 @@ public abstract partial class Entity : IEditableObject, INotifyPropertyChanged,
private bool _trackChanges;
private Entity _parent;
- private AssociationAttribute _parentAssociation;
+ private EntityAssociationAttribute _parentAssociation;
private bool _hasChildChanges;
private Dictionary _trackedInstances;
private MetaType _metaType;
@@ -86,7 +86,7 @@ internal Entity Parent
///
/// Gets the parent association for this entity.
///
- internal AssociationAttribute ParentAssociation
+ internal EntityAssociationAttribute ParentAssociation
{
get
{
@@ -121,7 +121,7 @@ internal MetaType MetaType
///
/// The parent.
/// The parent association.
- internal void SetParent(Entity parent, AssociationAttribute association)
+ internal void SetParent(Entity parent, EntityAssociationAttribute association)
{
if (this._parent != parent)
{
diff --git a/src/OpenRiaServices.Client/Framework/EntityAssociationAttribute.cs b/src/OpenRiaServices.Client/Framework/EntityAssociationAttribute.cs
new file mode 100644
index 000000000..99d42e944
--- /dev/null
+++ b/src/OpenRiaServices.Client/Framework/EntityAssociationAttribute.cs
@@ -0,0 +1,69 @@
+using System;
+using System.Collections.Generic;
+
+#pragma warning disable CS3015 // Type has no accessible constructors which use only CLS-compliant types
+
+namespace OpenRiaServices
+{
+ ///
+ /// Used to mark an Entity member as an association
+ ///
+ [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
+
+ public sealed class EntityAssociationAttribute : Attribute
+#pragma warning restore CS3015 // Type has no accessible constructors which use only CLS-compliant types
+ {
+ ///
+ /// Full form of constructor
+ ///
+ /// The name of the association. For bi-directional associations,
+ /// the name must be the same on both sides of the association
+ /// List of the property names of the key values on this side of the association
+ /// List of the property names of the key values on the other side of the association
+ public EntityAssociationAttribute(string name, string[] thisKey, string[] otherKey)
+ {
+ Name = name ?? throw new ArgumentNullException(nameof(name));
+ ThisKeyMembers = thisKey ?? throw new ArgumentNullException(nameof(thisKey));
+ OtherKeyMembers = otherKey ?? throw new ArgumentNullException(nameof(otherKey));
+
+ if (name .Length == 0)
+ throw new ArgumentException("Name cannot be empty", nameof(name));
+ if (thisKey.Length == 0)
+ throw new ArgumentException("ThisKey cannot be empty", nameof(thisKey));
+ if (otherKey.Length == 0)
+ throw new ArgumentException("OtherKey cannot be empty", nameof(otherKey));
+ }
+
+ ///
+ /// Gets the name of the association. For bi-directional associations, the name must
+ /// be the same on both sides of the association
+ ///
+ public string Name { get; }
+
+ ///
+ /// Gets or sets a value indicating whether this association member represents
+ /// the foreign key side of an association
+ ///
+ public bool IsForeignKey { get; set; }
+
+ ///
+ /// Gets the collection of individual key members specified in the ThisKey string.
+ ///
+ public IReadOnlyCollection ThisKeyMembers { get; }
+
+ ///
+ /// Gets the collection of individual key members specified in the OtherKey string.
+ ///
+ public IReadOnlyCollection OtherKeyMembers { get; }
+
+ ///
+ /// Gets or sets the key value on this side of the association
+ ///
+ public string ThisKey => string.Join(",", ThisKeyMembers);
+
+ ///
+ /// representation of the key value on the other side of the association
+ ///
+ public string OtherKey => string.Join(",", OtherKeyMembers);
+ }
+}
diff --git a/src/OpenRiaServices.Client/Framework/EntityCollection.cs b/src/OpenRiaServices.Client/Framework/EntityCollection.cs
index 76fb74a90..d73850244 100644
--- a/src/OpenRiaServices.Client/Framework/EntityCollection.cs
+++ b/src/OpenRiaServices.Client/Framework/EntityCollection.cs
@@ -41,7 +41,7 @@ public sealed class EntityCollection : IEntityCollection, IEntityCollec
private bool _entitiesLoaded;
private bool _entitiesAdded;
- private AssociationAttribute AssocAttribute => _metaMember.AssociationAttribute;
+ private EntityAssociationAttribute AssocAttribute => _metaMember.AssociationAttribute;
private bool IsComposition => _metaMember.IsComposition;
///
@@ -74,7 +74,7 @@ public EntityCollection(Entity parent, string memberName, Func en
{
throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resource.Property_Does_Not_Exist, parent.GetType(), memberName), nameof(memberName));
}
- if (this._metaMember.AssociationAttribute == null)
+ if (!this._metaMember.IsAssociationMember)
{
throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resource.MemberMustBeAssociation, memberName), nameof(memberName));
}
@@ -770,7 +770,7 @@ private void ResetLoadedEntities()
#endregion
#region IEntityCollection Members
- AssociationAttribute IEntityCollection.Association
+ EntityAssociationAttribute IEntityCollection.Association
{
get
{
diff --git a/src/OpenRiaServices.Client/Framework/EntityRef.cs b/src/OpenRiaServices.Client/Framework/EntityRef.cs
index 9d89d3481..89076a4a5 100644
--- a/src/OpenRiaServices.Client/Framework/EntityRef.cs
+++ b/src/OpenRiaServices.Client/Framework/EntityRef.cs
@@ -27,7 +27,7 @@ public sealed class EntityRef : IEntityRef where TEntity : Entity
private string MemberName => _metaMember.Name;
private bool IsComposition => _metaMember.IsComposition;
- private AssociationAttribute AssocAttribute => _metaMember.AssociationAttribute;
+ private EntityAssociationAttribute AssocAttribute => _metaMember.AssociationAttribute;
///
/// Initializes a new instance of the EntityRef class
@@ -58,7 +58,7 @@ public EntityRef(Entity parent, string memberName, Func entityPre
{
throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resource.Property_Does_Not_Exist, parent.GetType(), memberName), nameof(memberName));
}
- if (this._metaMember.AssociationAttribute == null)
+ if (!this._metaMember.IsAssociationMember)
{
throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resource.MemberMustBeAssociation, memberName), nameof(memberName));
}
@@ -393,7 +393,7 @@ private void ParentEntityPropertyChanged(object sender, PropertyChangedEventArgs
}
#region IEntityRef Members
- AssociationAttribute IEntityRef.Association
+ EntityAssociationAttribute IEntityRef.Association
{
get
{
@@ -441,7 +441,7 @@ internal interface IEntityRef
///
/// Gets the AssociationAttribute for this reference.
///
- AssociationAttribute Association
+ EntityAssociationAttribute Association
{
get;
}
diff --git a/src/OpenRiaServices.Client/Framework/EntitySet.cs b/src/OpenRiaServices.Client/Framework/EntitySet.cs
index 1d2d35237..5e04b18e2 100644
--- a/src/OpenRiaServices.Client/Framework/EntitySet.cs
+++ b/src/OpenRiaServices.Client/Framework/EntitySet.cs
@@ -20,7 +20,7 @@ namespace OpenRiaServices.Client
///
public abstract class EntitySet : IEnumerable, ICollection, INotifyCollectionChanged, IRevertibleChangeTracking, INotifyPropertyChanged
{
- private readonly Dictionary> _associationUpdateCallbackMap = new Dictionary>();
+ private readonly Dictionary> _associationUpdateCallbackMap = new();
private readonly Type _entityType;
private EntityContainer _entityContainer;
private EntitySetOperations _supportedOperations;
@@ -305,7 +305,7 @@ internal void UpdateRelatedAssociations(Entity entity, string propertyName)
/// AssociationAttribute indicating the association to monitor
/// The callback to call
/// True if the callback is being registered, false if it is being unregistered
- internal void RegisterAssociationCallback(AssociationAttribute association, Action callback, bool register)
+ internal void RegisterAssociationCallback(EntityAssociationAttribute association, Action callback, bool register)
{
this._associationUpdateCallbackMap.TryGetValue(association, out Action del);
if (register)
@@ -1426,7 +1426,7 @@ public int Add(object value)
int countBefore = this.Source.Count;
this.Source.Add(entity);
- return this.Source.Count == countBefore + 1
+ return this.Source.Count == countBefore + 1
? countBefore
: ((List)this.Source.List).IndexOf(entity, countBefore);
}
diff --git a/src/OpenRiaServices.Client/Framework/IEntityCollection.cs b/src/OpenRiaServices.Client/Framework/IEntityCollection.cs
index fc2b7bf77..f7e15681a 100644
--- a/src/OpenRiaServices.Client/Framework/IEntityCollection.cs
+++ b/src/OpenRiaServices.Client/Framework/IEntityCollection.cs
@@ -13,7 +13,7 @@ internal interface IEntityCollection
///
/// Gets the AssociationAttribute for this collection.
///
- AssociationAttribute Association
+ EntityAssociationAttribute Association
{
get;
}
diff --git a/src/OpenRiaServices.Client/Framework/Internal/MetaMember.cs b/src/OpenRiaServices.Client/Framework/Internal/MetaMember.cs
index 596a03fee..ace860341 100644
--- a/src/OpenRiaServices.Client/Framework/Internal/MetaMember.cs
+++ b/src/OpenRiaServices.Client/Framework/Internal/MetaMember.cs
@@ -44,7 +44,21 @@ internal MetaMember(MetaType metaType, PropertyInfo property, bool isRoundtripEn
IsKeyMember = TypeUtility.IsAttributeDefined(property, typeof(KeyAttribute), false);
IsComposition = TypeUtility.IsAttributeDefined(property, typeof(CompositionAttribute), false);
- AssociationAttribute = (AssociationAttribute)property.GetCustomAttributes(typeof(AssociationAttribute), false).SingleOrDefault();
+ if (property.GetCustomAttribute(false) is { } association)
+ {
+ this.AssociationAttribute = association;
+ }
+#pragma warning disable CS0618 // Type or member is obsolete
+ // TODO: Remove fallback when code generation has used the never attribute for a little while
+ else if (property.GetCustomAttribute(false) is { } associationAttribute)
+ {
+ this.AssociationAttribute = new EntityAssociationAttribute(associationAttribute.Name, associationAttribute.ThisKeyMembers.ToArray(), associationAttribute.OtherKeyMembers.ToArray())
+ {
+ IsForeignKey = associationAttribute.IsForeignKey,
+ };
+ }
+#pragma warning restore CS0618 // Type or member is obsolete
+
EditableAttribute = (EditableAttribute)property.GetCustomAttributes(typeof(EditableAttribute), false).SingleOrDefault();
IsRoundtripMember = CheckIfRoundtripMember(this, isRoundtripEntity);
@@ -88,7 +102,7 @@ internal MetaMember(MetaType metaType, PropertyInfo property, bool isRoundtripEn
/// Gets any applied to the property, or null
/// if no attribute is specified for the property
///
- public AssociationAttribute AssociationAttribute { get; }
+ public EntityAssociationAttribute AssociationAttribute { get; }
///
/// Gets a value indicating whether this member is one of the supported values to send between
diff --git a/src/OpenRiaServices.Client/Framework/OpenRiaServices.Client.csproj b/src/OpenRiaServices.Client/Framework/OpenRiaServices.Client.csproj
index a0a7292a9..a3034582f 100644
--- a/src/OpenRiaServices.Client/Framework/OpenRiaServices.Client.csproj
+++ b/src/OpenRiaServices.Client/Framework/OpenRiaServices.Client.csproj
@@ -3,8 +3,6 @@
net472;netstandard2.0;net6.0-windows
-
- $(NoWarn);CS0618
$(DefineConstants);HAS_COLLECTIONVIEW
true
diff --git a/src/OpenRiaServices.Client/Test/Client.Test/Data/DataAnnotationsTests.cs b/src/OpenRiaServices.Client/Test/Client.Test/Data/DataAnnotationsTests.cs
index 72fb9386f..367406b7b 100644
--- a/src/OpenRiaServices.Client/Test/Client.Test/Data/DataAnnotationsTests.cs
+++ b/src/OpenRiaServices.Client/Test/Client.Test/Data/DataAnnotationsTests.cs
@@ -13,18 +13,12 @@ public void TestDefaultDataAnnotationAttributeCtors()
{
Type[] _knownAttributeTypes = {
typeof(KeyAttribute),
- typeof(AssociationAttribute),
typeof(ConcurrencyCheckAttribute),
typeof(TimestampAttribute)
};
foreach (Type t in _knownAttributeTypes)
{
- if (t == typeof(AssociationAttribute)) {
- // no default constructor defined
- continue;
- }
-
Attribute attr = null;
string message = string.Empty;
try
@@ -38,22 +32,5 @@ public void TestDefaultDataAnnotationAttributeCtors()
Assert.IsNotNull(attr, "Default ctor failed for attribute type " + t.GetType().Name + message);
}
}
-
- [TestMethod]
- public void TestAssociationAttribute()
- {
- AssociationAttribute attr = new AssociationAttribute("name", "thisKey", "otherKey");
- attr.IsForeignKey = false;
-
- Assert.AreEqual("name", attr.Name);
- Assert.AreEqual("thisKey", attr.ThisKey);
- Assert.AreEqual("otherKey", attr.OtherKey);
- Assert.AreEqual(false, attr.IsForeignKey);
-
- // Verify can reverse polarity of foreign key
- attr.IsForeignKey = true;
- Assert.AreEqual(true, attr.IsForeignKey);
-
- }
}
}
diff --git a/src/OpenRiaServices.Server/Framework/OpenRiaServices.Server.csproj b/src/OpenRiaServices.Server/Framework/OpenRiaServices.Server.csproj
index cba3840bd..f628ea915 100644
--- a/src/OpenRiaServices.Server/Framework/OpenRiaServices.Server.csproj
+++ b/src/OpenRiaServices.Server/Framework/OpenRiaServices.Server.csproj
@@ -3,10 +3,6 @@
net472;netstandard2.0;net6.0
$(DefineConstants);SERVERFX
-
-
- $(NoWarn);CS0618
-
@@ -30,6 +26,7 @@
+
diff --git a/src/OpenRiaServices.Tools.TextTemplate/Framework/CSharpGenerators/AttributeGenerationHelpers/AttributeGeneratorHelper.cs b/src/OpenRiaServices.Tools.TextTemplate/Framework/CSharpGenerators/AttributeGenerationHelpers/AttributeGeneratorHelper.cs
index 2ce57fc7c..802ccacdf 100644
--- a/src/OpenRiaServices.Tools.TextTemplate/Framework/CSharpGenerators/AttributeGenerationHelpers/AttributeGeneratorHelper.cs
+++ b/src/OpenRiaServices.Tools.TextTemplate/Framework/CSharpGenerators/AttributeGenerationHelpers/AttributeGeneratorHelper.cs
@@ -1,9 +1,11 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
+using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Runtime.Serialization;
+using System.Text;
using OpenRiaServices.Server;
namespace OpenRiaServices.Tools.TextTemplate
@@ -57,6 +59,9 @@ internal class AttributeGeneratorHelper
{ typeof(EntityActionAttribute), null },
{ typeof(RequiresAuthenticationAttribute), null },
{ typeof(RequiresRoleAttribute), null },
+ // Translate all AssociationAttribute to EntityAssociationAttribute on the client
+ { typeof(AssociationAttribute), new EntityAssociationAttributeBuilder() },
+ //{ typeof(EntityAssociationAttribute), new EntityAssociationAttributeBuilder() },
};
public static AttributeDeclaration GetAttributeDeclaration(Attribute attribute, ClientCodeGenerator textTemplateClientCodeGenerator, bool forcePropagation)
@@ -298,6 +303,25 @@ internal static string ConvertValueToCode(object value, bool isCSharp)
return CodeGenUtilities.GetTypeName(value.GetType()) + "." + value.ToString();
}
+ if (value is Array array)
+ {
+ Debug.Assert(isCSharp);
+
+ StringBuilder stringBuilder = new StringBuilder(200);
+
+ stringBuilder.Append($"new ");
+ stringBuilder.Append(CodeGenUtilities.GetTypeName(value.GetType().GetElementType()));
+ stringBuilder.Append("[] {");
+ for (int i=0; i < array.Length; i++)
+ {
+ if (i > 0)
+ stringBuilder.Append(", ");
+ stringBuilder.Append(ConvertValueToCode(array.GetValue(i), isCSharp));
+ }
+ stringBuilder.Append('}');
+ return stringBuilder.ToString();
+ }
+
return value.ToString();
}
diff --git a/src/OpenRiaServices.Tools.TextTemplate/Framework/OpenRiaServices.Tools.TextTemplate.csproj b/src/OpenRiaServices.Tools.TextTemplate/Framework/OpenRiaServices.Tools.TextTemplate.csproj
index f9e82f77b..52cd960ac 100644
--- a/src/OpenRiaServices.Tools.TextTemplate/Framework/OpenRiaServices.Tools.TextTemplate.csproj
+++ b/src/OpenRiaServices.Tools.TextTemplate/Framework/OpenRiaServices.Tools.TextTemplate.csproj
@@ -17,6 +17,7 @@
+
diff --git a/src/OpenRiaServices.Tools/Framework/MetadataPipeline/CustomAttributeGenerator.cs b/src/OpenRiaServices.Tools/Framework/MetadataPipeline/CustomAttributeGenerator.cs
index bcffc5976..a264d41ad 100644
--- a/src/OpenRiaServices.Tools/Framework/MetadataPipeline/CustomAttributeGenerator.cs
+++ b/src/OpenRiaServices.Tools/Framework/MetadataPipeline/CustomAttributeGenerator.cs
@@ -66,6 +66,10 @@ internal static class CustomAttributeGenerator
{ typeof(EntityActionAttribute), null },
{ typeof(RequiresAuthenticationAttribute), null },
{ typeof(RequiresRoleAttribute), null },
+
+ // Translate all AssociationAttribute to EntityAssociationAttribute on the client
+ { typeof(AssociationAttribute), new EntityAssociationAttributeBuilder() },
+ //{ typeof(EntityAssociationAttribute), new EntityAssociationAttributeBuilder() },
};
///
@@ -662,6 +666,16 @@ private static CodeExpression CreateCodeExpression(CodeDomClientCodeGenerator pr
}
return e;
}
+ // Handle arrays
+ if (value is Array array)
+ {
+ CodeArrayCreateExpression arrayCreateExpression = new CodeArrayCreateExpression(CodeGenUtilities.GetTypeReference(typeOfValue.GetElementType(), proxyGenerator, referencingType), array.Length);
+ foreach (object element in array)
+ {
+ arrayCreateExpression.Initializers.Add(CreateCodeExpression(proxyGenerator, referencingType, element));
+ }
+ return arrayCreateExpression;
+ }
// typeof(T) requires special handling
Type valueAsType = value as Type;
diff --git a/src/OpenRiaServices.Tools/Framework/MetadataPipeline/EntityAssociationAttributeBuilder.cs b/src/OpenRiaServices.Tools/Framework/MetadataPipeline/EntityAssociationAttributeBuilder.cs
new file mode 100644
index 000000000..a9ccc4b5c
--- /dev/null
+++ b/src/OpenRiaServices.Tools/Framework/MetadataPipeline/EntityAssociationAttributeBuilder.cs
@@ -0,0 +1,52 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+
+namespace OpenRiaServices.Tools
+{
+ ///
+ /// Custom attribute builder generates representations of
+ /// instances.
+ ///
+ internal class EntityAssociationAttributeBuilder : ICustomAttributeBuilder
+ {
+ ///
+ /// Generates a representation of an
+ /// instance.
+ ///
+ public AttributeDeclaration GetAttributeDeclaration(Attribute attribute)
+ {
+ AttributeDeclaration attributeDeclaration = new AttributeDeclaration(typeof(EntityAssociationAttribute));
+
+ if (attribute is EntityAssociationAttribute entityAssociation)
+ {
+ attributeDeclaration.ConstructorArguments.Add(entityAssociation.Name);
+ attributeDeclaration.ConstructorArguments.Add((string[])entityAssociation.ThisKeyMembers);
+ attributeDeclaration.ConstructorArguments.Add((string[])entityAssociation.OtherKeyMembers);
+
+ if (entityAssociation.IsForeignKey)
+ {
+ attributeDeclaration.NamedParameters.Add(nameof(EntityAssociationAttribute.IsForeignKey), true);
+ }
+ }
+ else if (attribute is AssociationAttribute associationAttribute)
+ {
+ // [EntityAssociation( {true|false} )]
+ attributeDeclaration.ConstructorArguments.Add(associationAttribute.Name);
+ attributeDeclaration.ConstructorArguments.Add(associationAttribute.ThisKeyMembers.ToArray());
+ attributeDeclaration.ConstructorArguments.Add(associationAttribute.OtherKeyMembers.ToArray());
+
+ if (associationAttribute.IsForeignKey)
+ {
+ attributeDeclaration.NamedParameters.Add(nameof(EntityAssociationAttribute.IsForeignKey), true);
+ }
+ }
+ else
+ {
+ return null;
+ }
+
+ return attributeDeclaration;
+ }
+ }
+}
diff --git a/src/OpenRiaServices.Tools/Test/AssemblyGenerator.cs b/src/OpenRiaServices.Tools/Test/AssemblyGenerator.cs
index 3da9aa0cf..50c99158a 100644
--- a/src/OpenRiaServices.Tools/Test/AssemblyGenerator.cs
+++ b/src/OpenRiaServices.Tools/Test/AssemblyGenerator.cs
@@ -7,6 +7,8 @@
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.CodeAnalysis.Text;
+using System.Collections.ObjectModel;
+using System.Collections;
namespace OpenRiaServices.Tools.Test
{
@@ -316,6 +318,13 @@ internal static bool TryGetCustomAttributeValue(CustomAttributeData attribute
value = (T)ctorArg.Value;
return true;
}
+ // Special case to handle backwards compat for tests written againt AssociationAttribute
+ // that takes string arguments in constructor insterad of Arrrays as EntityAssociationAttribute does
+ else if (typeof(T) == typeof(string) && ctorArg.ArgumentType.IsArray)
+ {
+ value = (T)(object)string.Join(", ", ((IEnumerable)ctorArg.Value).Select(arg => arg.Value?.ToString() ?? "null"));
+ return true;
+ }
}
}
diff --git a/src/OpenRiaServices.Tools/Test/CodeGenExternalAttributeTests.cs b/src/OpenRiaServices.Tools/Test/CodeGenExternalAttributeTests.cs
index d272941d5..c2ec0a2d9 100644
--- a/src/OpenRiaServices.Tools/Test/CodeGenExternalAttributeTests.cs
+++ b/src/OpenRiaServices.Tools/Test/CodeGenExternalAttributeTests.cs
@@ -54,7 +54,7 @@ public void CodeGen_External_Entity_EFtoPOCO()
TestHelper.AssertGeneratedCodeContains(
generatedCode,
"private EntityRef _personalDetails_MarkedAsExternal;",
- "[Association(\"Employee_PersonalDetails\", \"EmployeeID\", \"UniqueID\", IsForeignKey=true)] [ExternalReference()]",
+ "[EntityAssociation(\"Employee_PersonalDetails\", new string[] { \"EmployeeID\"}, new string[] { \"UniqueID\"}, IsForeignKey=true)] [ExternalReference()]",
"public global::DataTests.Scenarios.EF.Northwind.PersonalDetails PersonalDetails_MarkedAsExternal",
"private bool FilterPersonalDetails_MarkedAsExternal(global::DataTests.Scenarios.EF.Northwind.PersonalDetails entity)");
}
diff --git a/src/OpenRiaServices.Tools/Test/InheritanceCodeGenTests.cs b/src/OpenRiaServices.Tools/Test/InheritanceCodeGenTests.cs
index b81518391..23608a610 100644
--- a/src/OpenRiaServices.Tools/Test/InheritanceCodeGenTests.cs
+++ b/src/OpenRiaServices.Tools/Test/InheritanceCodeGenTests.cs
@@ -290,7 +290,7 @@ public void Inherit_Gen_Assoc_Uni_Derived_To_Included_Root()
Assert.IsNotNull(pInfo, "Expected 'Target' property on derived type");
Assert.AreEqual(otherType, pInfo.PropertyType, "'Target' property should have been of type " + otherType);
- CustomAttributeData assocCad = AssemblyGenerator.GetCustomAttributeData(pInfo, typeof(AssociationAttribute)).SingleOrDefault();
+ CustomAttributeData assocCad = AssemblyGenerator.GetCustomAttributeData(pInfo, typeof(EntityAssociationAttribute)).SingleOrDefault();
Assert.IsNotNull(assocCad, "Could not find Association custom attribute data on 'Target' property");
string value = AssemblyGenerator.GetCustomAttributeValue(assocCad, "thisKey");
@@ -347,7 +347,7 @@ public void Inherit_Gen_Assoc_Bi_Derived_To_Included_Root()
Assert.IsNotNull(pInfo, "Expected 'Target' property on derived type");
Assert.AreEqual(targetType, pInfo.PropertyType, "'Target' property should have been of type " + targetType);
- CustomAttributeData assocCad = AssemblyGenerator.GetCustomAttributeData(pInfo, typeof(AssociationAttribute)).SingleOrDefault();
+ CustomAttributeData assocCad = AssemblyGenerator.GetCustomAttributeData(pInfo, typeof(EntityAssociationAttribute)).SingleOrDefault();
Assert.IsNotNull(assocCad, "Could not find Association custom attribute data on 'Target' property");
string value = AssemblyGenerator.GetCustomAttributeValue(assocCad, "thisKey");
@@ -365,7 +365,7 @@ public void Inherit_Gen_Assoc_Bi_Derived_To_Included_Root()
Assert.IsNotNull(pInfo, "Expected 'Source' property on target type");
Assert.AreEqual(derivedType, pInfo.PropertyType, "'Source' property should have been of type " + derivedType);
- assocCad = AssemblyGenerator.GetCustomAttributeData(pInfo, typeof(AssociationAttribute)).SingleOrDefault();
+ assocCad = AssemblyGenerator.GetCustomAttributeData(pInfo, typeof(EntityAssociationAttribute)).SingleOrDefault();
Assert.IsNotNull(assocCad, "Could not find Association custom attribute data on 'Source' property");
value = AssemblyGenerator.GetCustomAttributeValue(assocCad, "thisKey");
@@ -428,7 +428,7 @@ public void Inherit_Gen_Assoc_Bi_Derived_To_Included_Derived()
Assert.IsNotNull(pInfo, "Expected 'Target' property on derived type");
Assert.AreEqual(targetType, pInfo.PropertyType, "'Target' property should have been of type " + targetType);
- CustomAttributeData assocCad = AssemblyGenerator.GetCustomAttributeData(pInfo, typeof(AssociationAttribute)).SingleOrDefault();
+ CustomAttributeData assocCad = AssemblyGenerator.GetCustomAttributeData(pInfo, typeof(EntityAssociationAttribute)).SingleOrDefault();
Assert.IsNotNull(assocCad, "Could not find Association custom attribute data on 'Target' property");
string value = AssemblyGenerator.GetCustomAttributeValue(assocCad, "thisKey");
@@ -446,7 +446,7 @@ public void Inherit_Gen_Assoc_Bi_Derived_To_Included_Derived()
Assert.IsNotNull(pInfo, "Expected 'Source' property on target type");
Assert.AreEqual(derivedType, pInfo.PropertyType, "'Source' property should have been of type " + derivedType);
- assocCad = AssemblyGenerator.GetCustomAttributeData(pInfo, typeof(AssociationAttribute)).SingleOrDefault();
+ assocCad = AssemblyGenerator.GetCustomAttributeData(pInfo, typeof(EntityAssociationAttribute)).SingleOrDefault();
Assert.IsNotNull(assocCad, "Could not find Association custom attribute data on 'Source' property");
value = AssemblyGenerator.GetCustomAttributeValue(assocCad, "thisKey");
@@ -513,7 +513,7 @@ public void Inherit_Gen_Assoc_Bi_Derived_To_Included_Derived_OneToMany()
Type genericType = propType.GetGenericArguments()[0];
Assert.AreEqual(targetType, genericType, "'Targets' property should have been of type " + targetType + ", not " + genericType);
- CustomAttributeData assocCad = AssemblyGenerator.GetCustomAttributeData(pInfo, typeof(AssociationAttribute)).SingleOrDefault();
+ CustomAttributeData assocCad = AssemblyGenerator.GetCustomAttributeData(pInfo, typeof(EntityAssociationAttribute)).SingleOrDefault();
Assert.IsNotNull(assocCad, "Could not find Association custom attribute data on 'Targets' property");
string value = AssemblyGenerator.GetCustomAttributeValue(assocCad, "thisKey");
@@ -532,7 +532,7 @@ public void Inherit_Gen_Assoc_Bi_Derived_To_Included_Derived_OneToMany()
propType = pInfo.PropertyType;
Assert.AreEqual(derivedType, propType, "'Sources' property should have been of type " + derivedType + ", not " + propType);
- assocCad = AssemblyGenerator.GetCustomAttributeData(pInfo, typeof(AssociationAttribute)).SingleOrDefault();
+ assocCad = AssemblyGenerator.GetCustomAttributeData(pInfo, typeof(EntityAssociationAttribute)).SingleOrDefault();
Assert.IsNotNull(assocCad, "Could not find Association custom attribute data on 'Source' property");
value = AssemblyGenerator.GetCustomAttributeValue(assocCad, "thisKey");
@@ -597,7 +597,7 @@ public void Inherit_Gen_Assoc_Bi_Derived_To_Included_Derived_ManyToOne()
Type propType = pInfo.PropertyType;
Assert.AreEqual(targetType, propType, "'Target' property should have been of type " + targetType + ", not " + propType);
- CustomAttributeData assocCad = AssemblyGenerator.GetCustomAttributeData(pInfo, typeof(AssociationAttribute)).SingleOrDefault();
+ CustomAttributeData assocCad = AssemblyGenerator.GetCustomAttributeData(pInfo, typeof(EntityAssociationAttribute)).SingleOrDefault();
Assert.IsNotNull(assocCad, "Could not find Association custom attribute data on 'Targets' property");
string value = AssemblyGenerator.GetCustomAttributeValue(assocCad, "thisKey");
@@ -619,7 +619,7 @@ public void Inherit_Gen_Assoc_Bi_Derived_To_Included_Derived_ManyToOne()
Type genericType = propType.GetGenericArguments()[0];
Assert.AreEqual(derivedType, genericType, "'Sources' property should have been of type " + derivedType + ", not " + genericType);
- assocCad = AssemblyGenerator.GetCustomAttributeData(pInfo, typeof(AssociationAttribute)).SingleOrDefault();
+ assocCad = AssemblyGenerator.GetCustomAttributeData(pInfo, typeof(EntityAssociationAttribute)).SingleOrDefault();
Assert.IsNotNull(assocCad, "Could not find Association custom attribute data on 'Source' property");
value = AssemblyGenerator.GetCustomAttributeValue(assocCad, "thisKey");
@@ -691,7 +691,7 @@ public void Inherit_Gen_Projection_Bi_Derived_To_Included_Derived()
Assert.IsNotNull(pInfo, "Expected 'Target' property on derived type");
Assert.AreEqual(targetType, pInfo.PropertyType, "'Target' property should have been of type " + targetType);
- CustomAttributeData assocCad = AssemblyGenerator.GetCustomAttributeData(pInfo, typeof(AssociationAttribute)).SingleOrDefault();
+ CustomAttributeData assocCad = AssemblyGenerator.GetCustomAttributeData(pInfo, typeof(EntityAssociationAttribute)).SingleOrDefault();
Assert.IsNotNull(assocCad, "Could not find Association custom attribute data on 'Target' property");
string value = AssemblyGenerator.GetCustomAttributeValue(assocCad, "thisKey");
@@ -709,7 +709,7 @@ public void Inherit_Gen_Projection_Bi_Derived_To_Included_Derived()
Assert.IsNotNull(pInfo, "Expected 'Source' property on target type");
Assert.AreEqual(derivedType, pInfo.PropertyType, "'Source' property should have been of type " + derivedType);
- assocCad = AssemblyGenerator.GetCustomAttributeData(pInfo, typeof(AssociationAttribute)).SingleOrDefault();
+ assocCad = AssemblyGenerator.GetCustomAttributeData(pInfo, typeof(EntityAssociationAttribute)).SingleOrDefault();
Assert.IsNotNull(assocCad, "Could not find Association custom attribute data on 'Source' property");
value = AssemblyGenerator.GetCustomAttributeValue(assocCad, "thisKey");
@@ -790,7 +790,7 @@ public void Inherit_Gen_Projection_Bi_Derived_To_Included_Derived_Reversed()
Assert.IsNotNull(pInfo, "Expected 'Target' property on derived type");
Assert.AreEqual(targetType, pInfo.PropertyType, "'Target' property should have been of type " + targetType);
- CustomAttributeData assocCad = AssemblyGenerator.GetCustomAttributeData(pInfo, typeof(AssociationAttribute)).SingleOrDefault();
+ CustomAttributeData assocCad = AssemblyGenerator.GetCustomAttributeData(pInfo, typeof(EntityAssociationAttribute)).SingleOrDefault();
Assert.IsNotNull(assocCad, "Could not find Association custom attribute data on 'Target' property");
string value = AssemblyGenerator.GetCustomAttributeValue(assocCad, "thisKey");
@@ -808,7 +808,7 @@ public void Inherit_Gen_Projection_Bi_Derived_To_Included_Derived_Reversed()
Assert.IsNotNull(pInfo, "Expected 'Source' property on target type");
Assert.AreEqual(derivedType, pInfo.PropertyType, "'Source' property should have been of type " + derivedType);
- assocCad = AssemblyGenerator.GetCustomAttributeData(pInfo, typeof(AssociationAttribute)).SingleOrDefault();
+ assocCad = AssemblyGenerator.GetCustomAttributeData(pInfo, typeof(EntityAssociationAttribute)).SingleOrDefault();
Assert.IsNotNull(assocCad, "Could not find Association custom attribute data on 'Source' property");
value = AssemblyGenerator.GetCustomAttributeValue(assocCad, "thisKey");
diff --git a/src/OpenRiaServices.Tools/Test/MockSharedCodeService.cs b/src/OpenRiaServices.Tools/Test/MockSharedCodeService.cs
index 603a3c4fb..e826d1549 100644
--- a/src/OpenRiaServices.Tools/Test/MockSharedCodeService.cs
+++ b/src/OpenRiaServices.Tools/Test/MockSharedCodeService.cs
@@ -27,9 +27,10 @@ class MockSharedCodeService : ISharedCodeService, IDisposable
typeof(DataMemberAttribute),
typeof(System.ComponentModel.DescriptionAttribute),
typeof(DomainIdentifierAttribute),
- typeof(ExternalReferenceAttribute),
+ typeof(ExternalReferenceAttribute),
typeof(ReadOnlyAttribute),
- typeof(CompositionAttribute)
+ typeof(CompositionAttribute),
+ typeof(EntityAssociationAttribute)
};
private readonly HashSet _sharedTypes;
diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Cities/Cities.g.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Cities/Cities.g.cs
index 35be6e93b..7d9a0dae0 100644
--- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Cities/Cities.g.cs
+++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Cities/Cities.g.cs
@@ -112,7 +112,11 @@ public string CalculatedCounty
///
/// Gets or sets the associated entity.
///
- [Association("County_City", "CountyName,StateName", "Name,StateName", IsForeignKey=true)]
+ [EntityAssociation("County_City", new string[] {
+ "CountyName",
+ "StateName"}, new string[] {
+ "Name",
+ "StateName"}, IsForeignKey=true)]
public County County
{
get
@@ -241,7 +245,13 @@ public string StateName
///
/// Gets the collection of associated entity instances.
///
- [Association("City_Zip", "Name, CountyName, StateName", "CityName, CountyName, StateName")]
+ [EntityAssociation("City_Zip", new string[] {
+ "Name",
+ "CountyName",
+ "StateName"}, new string[] {
+ "CityName",
+ "CountyName",
+ "StateName"})]
public EntityCollection ZipCodes
{
get
@@ -1587,7 +1597,13 @@ public string Info
///
/// Gets the collection of associated entity instances.
///
- [Association("CityWithInfo_ZipWithInfo", "Name, CountyName, StateName", "CityName, CountyName, StateName")]
+ [EntityAssociation("CityWithInfo_ZipWithInfo", new string[] {
+ "Name",
+ "CountyName",
+ "StateName"}, new string[] {
+ "CityName",
+ "CountyName",
+ "StateName"})]
public EntityCollection ZipCodesWithInfo
{
get
@@ -1685,7 +1701,11 @@ public County()
///
/// Gets the collection of associated entity instances.
///
- [Association("County_City", "Name,StateName", "CountyName,StateName")]
+ [EntityAssociation("County_City", new string[] {
+ "Name",
+ "StateName"}, new string[] {
+ "CountyName",
+ "StateName"})]
public EntityCollection Cities
{
get
@@ -1730,7 +1750,9 @@ public string Name
///
/// Gets or sets the associated entity.
///
- [Association("State_County", "StateName", "Name", IsForeignKey=true)]
+ [EntityAssociation("State_County", new string[] {
+ "StateName"}, new string[] {
+ "Name"}, IsForeignKey=true)]
public State State
{
get
@@ -1906,9 +1928,11 @@ public State()
///
/// Gets the collection of associated entity instances.
///
- [Association("State_County", "Name", "StateName")]
[CustomValidation(typeof(CountiesValidator), "AreCountiesValid")]
[Editable(false)]
+ [EntityAssociation("State_County", new string[] {
+ "Name"}, new string[] {
+ "StateName"})]
[ReadOnly(true)]
public EntityCollection Counties
{
@@ -2117,8 +2141,14 @@ public Zip()
///
/// Gets or sets the associated entity.
///
- [Association("City_Zip", "CityName, CountyName, StateName", "Name, CountyName, StateName", IsForeignKey=true)]
[CustomValidation(typeof(CityPropertyValidator), "IsValidCity")]
+ [EntityAssociation("City_Zip", new string[] {
+ "CityName",
+ "CountyName",
+ "StateName"}, new string[] {
+ "Name",
+ "CountyName",
+ "StateName"}, IsForeignKey=true)]
public City City
{
get
diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Cities/Cities.g.vb b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Cities/Cities.g.vb
index 7a96b090c..d71ecfe6c 100644
--- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Cities/Cities.g.vb
+++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Cities/Cities.g.vb
@@ -131,7 +131,7 @@ Namespace Cities
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property County() As County
Get
If (Me._county Is Nothing) Then
@@ -238,7 +238,7 @@ Namespace Cities
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property ZipCodes() As EntityCollection(Of Zip)
Get
If (Me._zipCodes Is Nothing) Then
@@ -1497,7 +1497,7 @@ Namespace Cities
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property ZipCodesWithInfo() As EntityCollection(Of ZipWithInfo)
Get
If (Me._zipCodesWithInfo Is Nothing) Then
@@ -1590,7 +1590,7 @@ Namespace Cities
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property Cities() As EntityCollection(Of City)
Get
If (Me._cities Is Nothing) Then
@@ -1628,7 +1628,7 @@ Namespace Cities
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property State() As State
Get
If (Me._state Is Nothing) Then
@@ -1791,9 +1791,9 @@ Namespace Cities
'''
''' Gets the collection of associated entity instances.
'''
- _
Public ReadOnly Property Counties() As EntityCollection(Of County)
Get
@@ -1995,8 +1995,8 @@ Namespace Cities
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property City() As City
Get
If (Me._city Is Nothing) Then
diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EF.g.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EF.g.cs
index f17756b53..ca1ba208d 100644
--- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EF.g.cs
+++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EF.g.cs
@@ -1,7 +1,6 @@
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
-// Runtime Version:4.0.30319.34209
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -296,7 +295,9 @@ public string LoginID
///
/// Gets or sets the associated entity.
///
- [Association("Employee_Employee", "ManagerID", "EmployeeID", IsForeignKey=true)]
+ [EntityAssociation("Employee_Employee", new string[] {
+ "ManagerID"}, new string[] {
+ "EmployeeID"}, IsForeignKey=true)]
public Employee Manager
{
get
@@ -440,7 +441,9 @@ public string NationalIDNumber
///
/// Gets the collection of associated entity instances.
///
- [Association("Employee_PurchaseOrder", "EmployeeID", "EmployeeID")]
+ [EntityAssociation("Employee_PurchaseOrder", new string[] {
+ "EmployeeID"}, new string[] {
+ "EmployeeID"})]
public EntityCollection PurchaseOrders
{
get
@@ -456,7 +459,9 @@ public EntityCollection PurchaseOrders
///
/// Gets the collection of associated entity instances.
///
- [Association("Employee_Employee", "EmployeeID", "ManagerID")]
+ [EntityAssociation("Employee_Employee", new string[] {
+ "EmployeeID"}, new string[] {
+ "ManagerID"})]
public EntityCollection Reports
{
get
@@ -1260,7 +1265,9 @@ public Nullable ProductSubcategoryID
///
/// Gets the collection of associated entity instances.
///
- [Association("Product_PurchaseOrderDetail", "ProductID", "ProductID")]
+ [EntityAssociation("Product_PurchaseOrderDetail", new string[] {
+ "ProductID"}, new string[] {
+ "ProductID"})]
public EntityCollection PurchaseOrderDetails
{
get
@@ -1630,7 +1637,9 @@ public PurchaseOrder()
///
/// Gets or sets the associated entity.
///
- [Association("Employee_PurchaseOrder", "EmployeeID", "EmployeeID", IsForeignKey=true)]
+ [EntityAssociation("Employee_PurchaseOrder", new string[] {
+ "EmployeeID"}, new string[] {
+ "EmployeeID"}, IsForeignKey=true)]
public Employee Employee
{
get
@@ -1770,7 +1779,9 @@ public DateTime OrderDate
///
/// Gets the collection of associated entity instances.
///
- [Association("PurchaseOrder_PurchaseOrderDetail", "PurchaseOrderID", "PurchaseOrderID")]
+ [EntityAssociation("PurchaseOrder_PurchaseOrderDetail", new string[] {
+ "PurchaseOrderID"}, new string[] {
+ "PurchaseOrderID"})]
public EntityCollection PurchaseOrderDetails
{
get
@@ -2206,7 +2217,9 @@ public short OrderQty
///
/// Gets or sets the associated entity.
///
- [Association("Product_PurchaseOrderDetail", "ProductID", "ProductID", IsForeignKey=true)]
+ [EntityAssociation("Product_PurchaseOrderDetail", new string[] {
+ "ProductID"}, new string[] {
+ "ProductID"}, IsForeignKey=true)]
public Product Product
{
get
@@ -2274,7 +2287,9 @@ public int ProductID
///
/// Gets or sets the associated entity.
///
- [Association("PurchaseOrder_PurchaseOrderDetail", "PurchaseOrderID", "PurchaseOrderID", IsForeignKey=true)]
+ [EntityAssociation("PurchaseOrder_PurchaseOrderDetail", new string[] {
+ "PurchaseOrderID"}, new string[] {
+ "PurchaseOrderID"}, IsForeignKey=true)]
public PurchaseOrder PurchaseOrder
{
get
diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EF.g.vb b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EF.g.vb
index 4164ccfb0..3f0fb4244 100644
--- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EF.g.vb
+++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EF.g.vb
@@ -1,7 +1,6 @@
'------------------------------------------------------------------------------
'
' This code was generated by a tool.
-' Runtime Version:4.0.30319.34209
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
@@ -312,7 +311,7 @@ Namespace AdventureWorksModel
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Manager() As Employee
Get
If (Me._manager Is Nothing) Then
@@ -431,7 +430,7 @@ Namespace AdventureWorksModel
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property PurchaseOrders() As EntityCollection(Of PurchaseOrder)
Get
If (Me._purchaseOrders Is Nothing) Then
@@ -444,7 +443,7 @@ Namespace AdventureWorksModel
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property Reports() As EntityCollection(Of Employee)
Get
If (Me._reports Is Nothing) Then
@@ -1214,7 +1213,7 @@ Namespace AdventureWorksModel
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property PurchaseOrderDetails() As EntityCollection(Of PurchaseOrderDetail)
Get
If (Me._purchaseOrderDetails Is Nothing) Then
@@ -1568,7 +1567,7 @@ Namespace AdventureWorksModel
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Employee() As Employee
Get
If (Me._employee Is Nothing) Then
@@ -1686,7 +1685,7 @@ Namespace AdventureWorksModel
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property PurchaseOrderDetails() As EntityCollection(Of PurchaseOrderDetail)
Get
If (Me._purchaseOrderDetails Is Nothing) Then
@@ -2097,7 +2096,7 @@ Namespace AdventureWorksModel
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Product() As Product
Get
If (Me._product Is Nothing) Then
@@ -2152,7 +2151,7 @@ Namespace AdventureWorksModel
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property PurchaseOrder() As PurchaseOrder
Get
If (Me._purchaseOrder Is Nothing) Then
diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFCore.g.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFCore.g.cs
index 627ff4311..7cc607d49 100644
--- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFCore.g.cs
+++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFCore.g.cs
@@ -1,7 +1,6 @@
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -292,7 +291,9 @@ public string LoginID
///
/// Gets or sets the associated entity.
///
- [Association("FK_Employee_Employee_ManagerID", "ManagerID", "EmployeeID", IsForeignKey=true)]
+ [EntityAssociation("FK_Employee_Employee_ManagerID", new string[] {
+ "ManagerID"}, new string[] {
+ "EmployeeID"}, IsForeignKey=true)]
public Employee Manager
{
get
@@ -1184,7 +1185,9 @@ public Nullable ProductSubcategoryID
///
/// Gets the collection of associated entity instances.
///
- [Association("FK_PurchaseOrderDetail_Product_ProductID", "ProductID", "ProductID")]
+ [EntityAssociation("FK_PurchaseOrderDetail_Product_ProductID", new string[] {
+ "ProductID"}, new string[] {
+ "ProductID"})]
public EntityCollection PurchaseOrderDetails
{
get
@@ -1646,7 +1649,9 @@ public DateTime OrderDate
///
/// Gets the collection of associated entity instances.
///
- [Association("FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID", "PurchaseOrderID", "PurchaseOrderID")]
+ [EntityAssociation("FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID", new string[] {
+ "PurchaseOrderID"}, new string[] {
+ "PurchaseOrderID"})]
public EntityCollection PurchaseOrderDetails
{
get
@@ -2075,7 +2080,9 @@ public short OrderQty
///
/// Gets or sets the associated entity.
///
- [Association("FK_PurchaseOrderDetail_Product_ProductID", "ProductID", "ProductID", IsForeignKey=true)]
+ [EntityAssociation("FK_PurchaseOrderDetail_Product_ProductID", new string[] {
+ "ProductID"}, new string[] {
+ "ProductID"}, IsForeignKey=true)]
public Product Product
{
get
@@ -2143,7 +2150,9 @@ public int ProductID
///
/// Gets or sets the associated entity.
///
- [Association("FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID", "PurchaseOrderID", "PurchaseOrderID", IsForeignKey=true)]
+ [EntityAssociation("FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID", new string[] {
+ "PurchaseOrderID"}, new string[] {
+ "PurchaseOrderID"}, IsForeignKey=true)]
public PurchaseOrder PurchaseOrder
{
get
diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFCore.g.vb b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFCore.g.vb
index ca5a9c6e6..2e40f6825 100644
--- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFCore.g.vb
+++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFCore.g.vb
@@ -1,7 +1,6 @@
'------------------------------------------------------------------------------
'
' This code was generated by a tool.
-' Runtime Version:4.0.30319.42000
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
@@ -308,7 +307,7 @@ Namespace EFCoreModels.AdventureWorks
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Manager() As Employee
Get
If (Me._manager Is Nothing) Then
@@ -1152,7 +1151,7 @@ Namespace EFCoreModels.AdventureWorks
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property PurchaseOrderDetails() As EntityCollection(Of PurchaseOrderDetail)
Get
If (Me._purchaseOrderDetails Is Nothing) Then
@@ -1586,7 +1585,7 @@ Namespace EFCoreModels.AdventureWorks
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property PurchaseOrderDetails() As EntityCollection(Of PurchaseOrderDetail)
Get
If (Me._purchaseOrderDetails Is Nothing) Then
@@ -1991,7 +1990,7 @@ Namespace EFCoreModels.AdventureWorks
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Product() As Product
Get
If (Me._product Is Nothing) Then
@@ -2046,7 +2045,7 @@ Namespace EFCoreModels.AdventureWorks
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property PurchaseOrder() As PurchaseOrder
Get
If (Me._purchaseOrder Is Nothing) Then
diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFDbCtx.g.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFDbCtx.g.cs
index 557a6b84c..d76ed628b 100644
--- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFDbCtx.g.cs
+++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFDbCtx.g.cs
@@ -1,7 +1,6 @@
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
-// Runtime Version:4.0.30319.34209
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -296,7 +295,9 @@ public string LoginID
///
/// Gets or sets the associated entity.
///
- [Association("Employee_Employee", "ManagerID", "EmployeeID", IsForeignKey=true)]
+ [EntityAssociation("Employee_Employee", new string[] {
+ "ManagerID"}, new string[] {
+ "EmployeeID"}, IsForeignKey=true)]
public Employee Manager
{
get
@@ -440,7 +441,9 @@ public string NationalIDNumber
///
/// Gets the collection of associated entity instances.
///
- [Association("Employee_PurchaseOrder", "EmployeeID", "EmployeeID")]
+ [EntityAssociation("Employee_PurchaseOrder", new string[] {
+ "EmployeeID"}, new string[] {
+ "EmployeeID"})]
public EntityCollection PurchaseOrders
{
get
@@ -456,7 +459,9 @@ public EntityCollection PurchaseOrders
///
/// Gets the collection of associated entity instances.
///
- [Association("Employee_Employee", "EmployeeID", "ManagerID")]
+ [EntityAssociation("Employee_Employee", new string[] {
+ "EmployeeID"}, new string[] {
+ "ManagerID"})]
public EntityCollection Reports
{
get
@@ -1260,7 +1265,9 @@ public Nullable ProductSubcategoryID
///
/// Gets the collection of associated entity instances.
///
- [Association("Product_PurchaseOrderDetail", "ProductID", "ProductID")]
+ [EntityAssociation("Product_PurchaseOrderDetail", new string[] {
+ "ProductID"}, new string[] {
+ "ProductID"})]
public EntityCollection PurchaseOrderDetails
{
get
@@ -1630,7 +1637,9 @@ public PurchaseOrder()
///
/// Gets or sets the associated entity.
///
- [Association("Employee_PurchaseOrder", "EmployeeID", "EmployeeID", IsForeignKey=true)]
+ [EntityAssociation("Employee_PurchaseOrder", new string[] {
+ "EmployeeID"}, new string[] {
+ "EmployeeID"}, IsForeignKey=true)]
public Employee Employee
{
get
@@ -1770,7 +1779,9 @@ public DateTime OrderDate
///
/// Gets the collection of associated entity instances.
///
- [Association("PurchaseOrder_PurchaseOrderDetail", "PurchaseOrderID", "PurchaseOrderID")]
+ [EntityAssociation("PurchaseOrder_PurchaseOrderDetail", new string[] {
+ "PurchaseOrderID"}, new string[] {
+ "PurchaseOrderID"})]
public EntityCollection PurchaseOrderDetails
{
get
@@ -2206,7 +2217,9 @@ public short OrderQty
///
/// Gets or sets the associated entity.
///
- [Association("Product_PurchaseOrderDetail", "ProductID", "ProductID", IsForeignKey=true)]
+ [EntityAssociation("Product_PurchaseOrderDetail", new string[] {
+ "ProductID"}, new string[] {
+ "ProductID"}, IsForeignKey=true)]
public Product Product
{
get
@@ -2274,7 +2287,9 @@ public int ProductID
///
/// Gets or sets the associated entity.
///
- [Association("PurchaseOrder_PurchaseOrderDetail", "PurchaseOrderID", "PurchaseOrderID", IsForeignKey=true)]
+ [EntityAssociation("PurchaseOrder_PurchaseOrderDetail", new string[] {
+ "PurchaseOrderID"}, new string[] {
+ "PurchaseOrderID"}, IsForeignKey=true)]
public PurchaseOrder PurchaseOrder
{
get
diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFDbCtx.g.vb b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFDbCtx.g.vb
index 732334525..d57ddc666 100644
--- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFDbCtx.g.vb
+++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFDbCtx.g.vb
@@ -1,7 +1,6 @@
'------------------------------------------------------------------------------
'
' This code was generated by a tool.
-' Runtime Version:4.0.30319.34209
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
@@ -312,7 +311,7 @@ Namespace DbContextModels.AdventureWorks
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Manager() As Employee
Get
If (Me._manager Is Nothing) Then
@@ -431,7 +430,7 @@ Namespace DbContextModels.AdventureWorks
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property PurchaseOrders() As EntityCollection(Of PurchaseOrder)
Get
If (Me._purchaseOrders Is Nothing) Then
@@ -444,7 +443,7 @@ Namespace DbContextModels.AdventureWorks
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property Reports() As EntityCollection(Of Employee)
Get
If (Me._reports Is Nothing) Then
@@ -1214,7 +1213,7 @@ Namespace DbContextModels.AdventureWorks
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property PurchaseOrderDetails() As EntityCollection(Of PurchaseOrderDetail)
Get
If (Me._purchaseOrderDetails Is Nothing) Then
@@ -1568,7 +1567,7 @@ Namespace DbContextModels.AdventureWorks
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Employee() As Employee
Get
If (Me._employee Is Nothing) Then
@@ -1686,7 +1685,7 @@ Namespace DbContextModels.AdventureWorks
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property PurchaseOrderDetails() As EntityCollection(Of PurchaseOrderDetail)
Get
If (Me._purchaseOrderDetails Is Nothing) Then
@@ -2097,7 +2096,7 @@ Namespace DbContextModels.AdventureWorks
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Product() As Product
Get
If (Me._product Is Nothing) Then
@@ -2152,7 +2151,7 @@ Namespace DbContextModels.AdventureWorks
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property PurchaseOrder() As PurchaseOrder
Get
If (Me._purchaseOrder Is Nothing) Then
diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EF.g.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EF.g.cs
index 2b2152046..d483af373 100644
--- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EF.g.cs
+++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EF.g.cs
@@ -1,7 +1,6 @@
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
-// Runtime Version:4.0.30319.34209
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -170,7 +169,9 @@ public byte[] Picture
///
/// Gets the collection of associated entity instances.
///
- [Association("Category_Product", "CategoryID", "CategoryID")]
+ [EntityAssociation("Category_Product", new string[] {
+ "CategoryID"}, new string[] {
+ "CategoryID"})]
public EntityCollection Products
{
get
@@ -502,7 +503,9 @@ public string Fax
///
/// Gets the collection of associated entity instances.
///
- [Association("Customer_Order", "CustomerID", "CustomerID")]
+ [EntityAssociation("Customer_Order", new string[] {
+ "CustomerID"}, new string[] {
+ "CustomerID"})]
public EntityCollection Orders
{
get
@@ -714,7 +717,9 @@ public Order()
///
/// Gets or sets the associated entity.
///
- [Association("Customer_Order", "CustomerID", "CustomerID", IsForeignKey=true)]
+ [EntityAssociation("Customer_Order", new string[] {
+ "CustomerID"}, new string[] {
+ "CustomerID"}, IsForeignKey=true)]
public Customer Customer
{
get
@@ -861,7 +866,9 @@ public Nullable Freight
///
/// Gets the collection of associated entity instances.
///
- [Association("Order_Order_Detail", "OrderID", "OrderID")]
+ [EntityAssociation("Order_Order_Detail", new string[] {
+ "OrderID"}, new string[] {
+ "OrderID"})]
public EntityCollection Order_Details
{
get
@@ -1276,7 +1283,9 @@ public float Discount
///
/// Gets or sets the associated entity.
///
- [Association("Order_Order_Detail", "OrderID", "OrderID", IsForeignKey=true)]
+ [EntityAssociation("Order_Order_Detail", new string[] {
+ "OrderID"}, new string[] {
+ "OrderID"}, IsForeignKey=true)]
public Order Order
{
get
@@ -1346,7 +1355,9 @@ public int OrderID
///
/// Gets or sets the associated entity.
///
- [Association("Product_Order_Detail", "ProductID", "ProductID", IsForeignKey=true)]
+ [EntityAssociation("Product_Order_Detail", new string[] {
+ "ProductID"}, new string[] {
+ "ProductID"}, IsForeignKey=true)]
public Product Product
{
get
@@ -1572,7 +1583,9 @@ public Product()
///
/// Gets or sets the associated entity.
///
- [Association("Category_Product", "CategoryID", "CategoryID", IsForeignKey=true)]
+ [EntityAssociation("Category_Product", new string[] {
+ "CategoryID"}, new string[] {
+ "CategoryID"}, IsForeignKey=true)]
public Category Category
{
get
@@ -1692,7 +1705,9 @@ public bool Discontinued
///
/// Gets the collection of associated entity instances.
///
- [Association("Product_Order_Detail", "ProductID", "ProductID")]
+ [EntityAssociation("Product_Order_Detail", new string[] {
+ "ProductID"}, new string[] {
+ "ProductID"})]
public EntityCollection Order_Details
{
get
@@ -2270,8 +2285,10 @@ public int RegionID
///
/// Gets the collection of associated entity instances.
///
- [Association("Region_Territory", "RegionID", "RegionID")]
[Composition()]
+ [EntityAssociation("Region_Territory", new string[] {
+ "RegionID"}, new string[] {
+ "RegionID"})]
public EntityCollection Territories
{
get
@@ -2352,7 +2369,9 @@ public Territory()
///
/// Gets or sets the associated entity.
///
- [Association("Region_Territory", "RegionID", "RegionID", IsForeignKey=true)]
+ [EntityAssociation("Region_Territory", new string[] {
+ "RegionID"}, new string[] {
+ "RegionID"}, IsForeignKey=true)]
public Region Region
{
get
diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EF.g.vb b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EF.g.vb
index 0682a5baf..afdc7ab26 100644
--- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EF.g.vb
+++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EF.g.vb
@@ -1,7 +1,6 @@
'------------------------------------------------------------------------------
'
' This code was generated by a tool.
-' Runtime Version:4.0.30319.34209
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
@@ -170,7 +169,7 @@ Namespace NorthwindModel
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property Products() As EntityCollection(Of Product)
Get
If (Me._products Is Nothing) Then
@@ -486,7 +485,7 @@ Namespace NorthwindModel
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property Orders() As EntityCollection(Of Order)
Get
If (Me._orders Is Nothing) Then
@@ -710,7 +709,7 @@ Namespace NorthwindModel
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Customer() As Customer
Get
If (Me._customer Is Nothing) Then
@@ -831,7 +830,7 @@ Namespace NorthwindModel
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property Order_Details() As EntityCollection(Of Order_Detail)
Get
If (Me._order_Details Is Nothing) Then
@@ -1203,7 +1202,7 @@ Namespace NorthwindModel
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Order() As Order
Get
If (Me._order Is Nothing) Then
@@ -1260,7 +1259,7 @@ Namespace NorthwindModel
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Product() As Product
Get
If (Me._product Is Nothing) Then
@@ -1493,7 +1492,7 @@ Namespace NorthwindModel
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Category() As Category
Get
If (Me._category Is Nothing) Then
@@ -1592,7 +1591,7 @@ Namespace NorthwindModel
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property Order_Details() As EntityCollection(Of Order_Detail)
Get
If (Me._order_Details Is Nothing) Then
@@ -2109,8 +2108,8 @@ Namespace NorthwindModel
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property Territories() As EntityCollection(Of Territory)
Get
If (Me._territories Is Nothing) Then
@@ -2191,7 +2190,7 @@ Namespace NorthwindModel
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Region() As Region
Get
If (Me._region Is Nothing) Then
diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EFCore.g.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EFCore.g.cs
index 1696448d3..07944688c 100644
--- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EFCore.g.cs
+++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EFCore.g.cs
@@ -1,7 +1,6 @@
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -170,7 +169,9 @@ public byte[] Picture
///
/// Gets the collection of associated entity instances.
///
- [Association("Category_Product", "CategoryID", "CategoryID")]
+ [EntityAssociation("Category_Product", new string[] {
+ "CategoryID"}, new string[] {
+ "CategoryID"})]
public EntityCollection Products
{
get
@@ -502,7 +503,9 @@ public string Fax
///
/// Gets the collection of associated entity instances.
///
- [Association("Customer_Order", "CustomerID", "CustomerID")]
+ [EntityAssociation("Customer_Order", new string[] {
+ "CustomerID"}, new string[] {
+ "CustomerID"})]
public EntityCollection Orders
{
get
@@ -714,7 +717,9 @@ public Order()
///
/// Gets or sets the associated entity.
///
- [Association("Customer_Order", "CustomerID", "CustomerID", IsForeignKey=true)]
+ [EntityAssociation("Customer_Order", new string[] {
+ "CustomerID"}, new string[] {
+ "CustomerID"}, IsForeignKey=true)]
public Customer Customer
{
get
@@ -861,7 +866,9 @@ public Nullable Freight
///
/// Gets the collection of associated entity instances.
///
- [Association("Order_Order_Detail", "OrderID", "OrderID")]
+ [EntityAssociation("Order_Order_Detail", new string[] {
+ "OrderID"}, new string[] {
+ "OrderID"})]
public EntityCollection Order_Details
{
get
@@ -1276,7 +1283,9 @@ public float Discount
///
/// Gets or sets the associated entity.
///
- [Association("Order_Order_Detail", "OrderID", "OrderID", IsForeignKey=true)]
+ [EntityAssociation("Order_Order_Detail", new string[] {
+ "OrderID"}, new string[] {
+ "OrderID"}, IsForeignKey=true)]
public Order Order
{
get
@@ -1346,7 +1355,9 @@ public int OrderID
///
/// Gets or sets the associated entity.
///
- [Association("Product_Order_Detail", "ProductID", "ProductID", IsForeignKey=true)]
+ [EntityAssociation("Product_Order_Detail", new string[] {
+ "ProductID"}, new string[] {
+ "ProductID"}, IsForeignKey=true)]
public Product Product
{
get
@@ -1572,7 +1583,9 @@ public Product()
///
/// Gets or sets the associated entity.
///
- [Association("Category_Product", "CategoryID", "CategoryID", IsForeignKey=true)]
+ [EntityAssociation("Category_Product", new string[] {
+ "CategoryID"}, new string[] {
+ "CategoryID"}, IsForeignKey=true)]
public Category Category
{
get
@@ -1692,7 +1705,9 @@ public bool Discontinued
///
/// Gets the collection of associated entity instances.
///
- [Association("Product_Order_Detail", "ProductID", "ProductID")]
+ [EntityAssociation("Product_Order_Detail", new string[] {
+ "ProductID"}, new string[] {
+ "ProductID"})]
public EntityCollection Order_Details
{
get
@@ -2270,8 +2285,10 @@ public int RegionID
///
/// Gets the collection of associated entity instances.
///
- [Association("Region_Territory", "RegionID", "RegionID")]
[Composition()]
+ [EntityAssociation("Region_Territory", new string[] {
+ "RegionID"}, new string[] {
+ "RegionID"})]
public EntityCollection Territories
{
get
@@ -2352,7 +2369,9 @@ public Territory()
///
/// Gets or sets the associated entity.
///
- [Association("Region_Territory", "RegionID", "RegionID", IsForeignKey=true)]
+ [EntityAssociation("Region_Territory", new string[] {
+ "RegionID"}, new string[] {
+ "RegionID"}, IsForeignKey=true)]
public Region Region
{
get
diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EFCore.g.vb b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EFCore.g.vb
index 5251ad2cb..13e048d77 100644
--- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EFCore.g.vb
+++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EFCore.g.vb
@@ -1,7 +1,6 @@
'------------------------------------------------------------------------------
'
' This code was generated by a tool.
-' Runtime Version:4.0.30319.42000
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
@@ -170,7 +169,7 @@ Namespace EFCoreModels.Northwind
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property Products() As EntityCollection(Of Product)
Get
If (Me._products Is Nothing) Then
@@ -486,7 +485,7 @@ Namespace EFCoreModels.Northwind
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property Orders() As EntityCollection(Of Order)
Get
If (Me._orders Is Nothing) Then
@@ -710,7 +709,7 @@ Namespace EFCoreModels.Northwind
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Customer() As Customer
Get
If (Me._customer Is Nothing) Then
@@ -831,7 +830,7 @@ Namespace EFCoreModels.Northwind
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property Order_Details() As EntityCollection(Of Order_Detail)
Get
If (Me._order_Details Is Nothing) Then
@@ -1203,7 +1202,7 @@ Namespace EFCoreModels.Northwind
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Order() As Order
Get
If (Me._order Is Nothing) Then
@@ -1260,7 +1259,7 @@ Namespace EFCoreModels.Northwind
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Product() As Product
Get
If (Me._product Is Nothing) Then
@@ -1493,7 +1492,7 @@ Namespace EFCoreModels.Northwind
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Category() As Category
Get
If (Me._category Is Nothing) Then
@@ -1592,7 +1591,7 @@ Namespace EFCoreModels.Northwind
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property Order_Details() As EntityCollection(Of Order_Detail)
Get
If (Me._order_Details Is Nothing) Then
@@ -2109,8 +2108,8 @@ Namespace EFCoreModels.Northwind
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property Territories() As EntityCollection(Of Territory)
Get
If (Me._territories Is Nothing) Then
@@ -2191,7 +2190,7 @@ Namespace EFCoreModels.Northwind
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Region() As Region
Get
If (Me._region Is Nothing) Then
diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/LTS/Catalog_LTS.g.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/LTS/Catalog_LTS.g.cs
index 8eac6fdc3..5c580f005 100644
--- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/LTS/Catalog_LTS.g.cs
+++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/LTS/Catalog_LTS.g.cs
@@ -308,7 +308,9 @@ public string LoginID
///
/// Gets or sets the associated entity.
///
- [Association("Employee_Employee", "ManagerID", "EmployeeID", IsForeignKey=true)]
+ [EntityAssociation("Employee_Employee", new string[] {
+ "ManagerID"}, new string[] {
+ "EmployeeID"}, IsForeignKey=true)]
public Employee Manager
{
get
@@ -459,7 +461,9 @@ public string NationalIDNumber
///
/// Gets the collection of associated entity instances.
///
- [Association("Employee_PurchaseOrder", "EmployeeID", "EmployeeID")]
+ [EntityAssociation("Employee_PurchaseOrder", new string[] {
+ "EmployeeID"}, new string[] {
+ "EmployeeID"})]
public EntityCollection PurchaseOrders
{
get
@@ -475,7 +479,9 @@ public EntityCollection PurchaseOrders
///
/// Gets the collection of associated entity instances.
///
- [Association("Employee_Employee", "EmployeeID", "ManagerID")]
+ [EntityAssociation("Employee_Employee", new string[] {
+ "EmployeeID"}, new string[] {
+ "ManagerID"})]
public EntityCollection Reports
{
get
@@ -1164,7 +1170,9 @@ public Nullable ProductSubcategoryID
///
/// Gets the collection of associated entity instances.
///
- [Association("Product_PurchaseOrderDetail", "ProductID", "ProductID")]
+ [EntityAssociation("Product_PurchaseOrderDetail", new string[] {
+ "ProductID"}, new string[] {
+ "ProductID"})]
public EntityCollection PurchaseOrderDetails
{
get
@@ -1551,7 +1559,9 @@ public PurchaseOrder()
///
/// Gets or sets the associated entity.
///
- [Association("Employee_PurchaseOrder", "EmployeeID", "EmployeeID", IsForeignKey=true)]
+ [EntityAssociation("Employee_PurchaseOrder", new string[] {
+ "EmployeeID"}, new string[] {
+ "EmployeeID"}, IsForeignKey=true)]
public Employee Employee
{
get
@@ -1698,7 +1708,9 @@ public DateTime OrderDate
///
/// Gets the collection of associated entity instances.
///
- [Association("PurchaseOrder_PurchaseOrderDetail", "PurchaseOrderID", "PurchaseOrderID")]
+ [EntityAssociation("PurchaseOrder_PurchaseOrderDetail", new string[] {
+ "PurchaseOrderID"}, new string[] {
+ "PurchaseOrderID"})]
public EntityCollection PurchaseOrderDetails
{
get
@@ -2155,7 +2167,9 @@ public short OrderQty
///
/// Gets or sets the associated entity.
///
- [Association("Product_PurchaseOrderDetail", "ProductID", "ProductID", IsForeignKey=true)]
+ [EntityAssociation("Product_PurchaseOrderDetail", new string[] {
+ "ProductID"}, new string[] {
+ "ProductID"}, IsForeignKey=true)]
public Product Product
{
get
@@ -2224,7 +2238,9 @@ public int ProductID
///
/// Gets or sets the associated entity.
///
- [Association("PurchaseOrder_PurchaseOrderDetail", "PurchaseOrderID", "PurchaseOrderID", IsForeignKey=true)]
+ [EntityAssociation("PurchaseOrder_PurchaseOrderDetail", new string[] {
+ "PurchaseOrderID"}, new string[] {
+ "PurchaseOrderID"}, IsForeignKey=true)]
public PurchaseOrder PurchaseOrder
{
get
diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/LTS/Catalog_LTS.g.vb b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/LTS/Catalog_LTS.g.vb
index 3a0ca2fd3..b5c98b882 100644
--- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/LTS/Catalog_LTS.g.vb
+++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/LTS/Catalog_LTS.g.vb
@@ -324,7 +324,7 @@ Namespace DataTests.AdventureWorks.LTS
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Manager() As Employee
Get
If (Me._manager Is Nothing) Then
@@ -450,7 +450,7 @@ Namespace DataTests.AdventureWorks.LTS
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property PurchaseOrders() As EntityCollection(Of PurchaseOrder)
Get
If (Me._purchaseOrders Is Nothing) Then
@@ -463,7 +463,7 @@ Namespace DataTests.AdventureWorks.LTS
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property Reports() As EntityCollection(Of Employee)
Get
If (Me._reports Is Nothing) Then
@@ -1124,7 +1124,7 @@ Namespace DataTests.AdventureWorks.LTS
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property PurchaseOrderDetails() As EntityCollection(Of PurchaseOrderDetail)
Get
If (Me._purchaseOrderDetails Is Nothing) Then
@@ -1495,7 +1495,7 @@ Namespace DataTests.AdventureWorks.LTS
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Employee() As Employee
Get
If (Me._employee Is Nothing) Then
@@ -1620,7 +1620,7 @@ Namespace DataTests.AdventureWorks.LTS
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property PurchaseOrderDetails() As EntityCollection(Of PurchaseOrderDetail)
Get
If (Me._purchaseOrderDetails Is Nothing) Then
@@ -2052,7 +2052,7 @@ Namespace DataTests.AdventureWorks.LTS
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Product() As Product
Get
If (Me._product Is Nothing) Then
@@ -2108,7 +2108,7 @@ Namespace DataTests.AdventureWorks.LTS
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property PurchaseOrder() As PurchaseOrder
Get
If (Me._purchaseOrder Is Nothing) Then
diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/LTS/Northwind_LTS.g.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/LTS/Northwind_LTS.g.cs
index d1c03e823..a4ee800ea 100644
--- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/LTS/Northwind_LTS.g.cs
+++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/LTS/Northwind_LTS.g.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
-// Runtime Version:4.0.30319.34209
+// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -173,7 +173,9 @@ public byte[] Picture
///
/// Gets the collection of associated entity instances.
///
- [Association("Category_Product", "CategoryID", "CategoryID")]
+ [EntityAssociation("Category_Product", new string[] {
+ "CategoryID"}, new string[] {
+ "CategoryID"})]
public EntityCollection Products
{
get
@@ -505,7 +507,9 @@ public string Fax
///
/// Gets the collection of associated entity instances.
///
- [Association("Customer_Order", "CustomerID", "CustomerID")]
+ [EntityAssociation("Customer_Order", new string[] {
+ "CustomerID"}, new string[] {
+ "CustomerID"})]
public EntityCollection Orders
{
get
@@ -717,7 +721,9 @@ public Order()
///
/// Gets or sets the associated entity.
///
- [Association("Customer_Order", "CustomerID", "CustomerID", IsForeignKey=true)]
+ [EntityAssociation("Customer_Order", new string[] {
+ "CustomerID"}, new string[] {
+ "CustomerID"}, IsForeignKey=true)]
public Customer Customer
{
get
@@ -865,7 +871,9 @@ public Nullable Freight
///
/// Gets the collection of associated entity instances.
///
- [Association("Order_Order_Detail", "OrderID", "OrderID")]
+ [EntityAssociation("Order_Order_Detail", new string[] {
+ "OrderID"}, new string[] {
+ "OrderID"})]
public EntityCollection Order_Details
{
get
@@ -1280,7 +1288,9 @@ public float Discount
///
/// Gets or sets the associated entity.
///
- [Association("Order_Order_Detail", "OrderID", "OrderID", IsForeignKey=true)]
+ [EntityAssociation("Order_Order_Detail", new string[] {
+ "OrderID"}, new string[] {
+ "OrderID"}, IsForeignKey=true)]
public Order Order
{
get
@@ -1350,7 +1360,9 @@ public int OrderID
///
/// Gets or sets the associated entity.
///
- [Association("Product_Order_Detail", "ProductID", "ProductID", IsForeignKey=true)]
+ [EntityAssociation("Product_Order_Detail", new string[] {
+ "ProductID"}, new string[] {
+ "ProductID"}, IsForeignKey=true)]
public Product Product
{
get
@@ -1576,7 +1588,9 @@ public Product()
///
/// Gets or sets the associated entity.
///
- [Association("Category_Product", "CategoryID", "CategoryID", IsForeignKey=true)]
+ [EntityAssociation("Category_Product", new string[] {
+ "CategoryID"}, new string[] {
+ "CategoryID"}, IsForeignKey=true)]
public Category Category
{
get
@@ -1696,7 +1710,9 @@ public bool Discontinued
///
/// Gets the collection of associated entity instances.
///
- [Association("Product_Order_Detail", "ProductID", "ProductID")]
+ [EntityAssociation("Product_Order_Detail", new string[] {
+ "ProductID"}, new string[] {
+ "ProductID"})]
public EntityCollection Order_Details
{
get
@@ -2278,8 +2294,10 @@ public int RegionID
///
/// Gets the collection of associated entity instances.
///
- [Association("Region_Territory", "RegionID", "RegionID")]
[Composition()]
+ [EntityAssociation("Region_Territory", new string[] {
+ "RegionID"}, new string[] {
+ "RegionID"})]
public EntityCollection Territories
{
get
@@ -2360,7 +2378,9 @@ public Territory()
///
/// Gets or sets the associated entity.
///
- [Association("Region_Territory", "RegionID", "RegionID", IsForeignKey=true)]
+ [EntityAssociation("Region_Territory", new string[] {
+ "RegionID"}, new string[] {
+ "RegionID"}, IsForeignKey=true)]
public Region Region
{
get
diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/LTS/Northwind_LTS.g.vb b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/LTS/Northwind_LTS.g.vb
index ac5228ae6..bd3de8964 100644
--- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/LTS/Northwind_LTS.g.vb
+++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/LTS/Northwind_LTS.g.vb
@@ -1,7 +1,7 @@
'------------------------------------------------------------------------------
'
' This code was generated by a tool.
-' Runtime Version:4.0.30319.34209
+' Runtime Version:4.0.30319.42000
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
@@ -173,7 +173,7 @@ Namespace DataTests.Northwind.LTS
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property Products() As EntityCollection(Of Product)
Get
If (Me._products Is Nothing) Then
@@ -489,7 +489,7 @@ Namespace DataTests.Northwind.LTS
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property Orders() As EntityCollection(Of Order)
Get
If (Me._orders Is Nothing) Then
@@ -713,7 +713,7 @@ Namespace DataTests.Northwind.LTS
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Customer() As Customer
Get
If (Me._customer Is Nothing) Then
@@ -835,7 +835,7 @@ Namespace DataTests.Northwind.LTS
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property Order_Details() As EntityCollection(Of Order_Detail)
Get
If (Me._order_Details Is Nothing) Then
@@ -1207,7 +1207,7 @@ Namespace DataTests.Northwind.LTS
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Order() As Order
Get
If (Me._order Is Nothing) Then
@@ -1264,7 +1264,7 @@ Namespace DataTests.Northwind.LTS
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Product() As Product
Get
If (Me._product Is Nothing) Then
@@ -1497,7 +1497,7 @@ Namespace DataTests.Northwind.LTS
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Category() As Category
Get
If (Me._category Is Nothing) Then
@@ -1596,7 +1596,7 @@ Namespace DataTests.Northwind.LTS
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property Order_Details() As EntityCollection(Of Order_Detail)
Get
If (Me._order_Details Is Nothing) Then
@@ -2117,8 +2117,8 @@ Namespace DataTests.Northwind.LTS
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property Territories() As EntityCollection(Of Territory)
Get
If (Me._territories Is Nothing) Then
@@ -2199,7 +2199,7 @@ Namespace DataTests.Northwind.LTS
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Region() As Region
Get
If (Me._region Is Nothing) Then
diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Mocks/MockCustomers.g.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Mocks/MockCustomers.g.cs
index a1a1a7039..4e768dab7 100644
--- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Mocks/MockCustomers.g.cs
+++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Mocks/MockCustomers.g.cs
@@ -1,7 +1,6 @@
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
-// Runtime Version:4.0.30319.34209
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -70,7 +69,11 @@ public MockCustomer()
///
/// Gets or sets the associated entity.
///
- [Association("Customer_City", "CityName,StateName", "Name,StateName", IsForeignKey=true)]
+ [EntityAssociation("Customer_City", new string[] {
+ "CityName",
+ "StateName"}, new string[] {
+ "Name",
+ "StateName"}, IsForeignKey=true)]
[ExternalReference()]
public global::Cities.City City
{
@@ -156,7 +159,9 @@ public int CustomerId
///
/// Gets the collection of associated entity instances.
///
- [Association("Customer_PreviousResidences", "StateName", "StateName")]
+ [EntityAssociation("Customer_PreviousResidences", new string[] {
+ "StateName"}, new string[] {
+ "StateName"})]
[ExternalReference()]
public EntityCollection PreviousResidences
{
@@ -496,7 +501,9 @@ public MockReport()
///
/// Gets or sets the associated entity.
///
- [Association("R_C", "CustomerId", "CustomerId")]
+ [EntityAssociation("R_C", new string[] {
+ "CustomerId"}, new string[] {
+ "CustomerId"})]
public MockCustomer Customer
{
get
diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Mocks/MockCustomers.g.vb b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Mocks/MockCustomers.g.vb
index 4c4bea418..29da4ecca 100644
--- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Mocks/MockCustomers.g.vb
+++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Mocks/MockCustomers.g.vb
@@ -1,7 +1,6 @@
'------------------------------------------------------------------------------
'
' This code was generated by a tool.
-' Runtime Version:4.0.30319.34209
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
@@ -83,7 +82,7 @@ Namespace TestDomainServices
'''
''' Gets or sets the associated entity.
'''
- _
Public Property City() As Global.Cities.City
Get
@@ -154,7 +153,7 @@ Namespace TestDomainServices
'''
''' Gets the collection of associated entity instances.
'''
- _
Public ReadOnly Property PreviousResidences() As EntityCollection(Of Global.Cities.City)
Get
@@ -481,7 +480,7 @@ Namespace TestDomainServices
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Customer() As MockCustomer
Get
If (Me._customer Is Nothing) Then
diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/AttributeThrowing.g.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/AttributeThrowing.g.cs
index 022b389ac..7d3cbddcf 100644
--- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/AttributeThrowing.g.cs
+++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/AttributeThrowing.g.cs
@@ -1,7 +1,6 @@
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
-// Runtime Version:4.0.30319.34209
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -337,7 +336,9 @@ public string NonThrowingProperty
//
// - An exception occurred generating the 'ThrowingEntityAssociationAttributeProperty' property on attribute of type 'TestDomainServices.ThrowingEntityAssociationAttribute'.
//
- [Association("Association", "ThrowingProperty", "NonThrowingProperty", IsForeignKey=true)]
+ [EntityAssociation("Association", new string[] {
+ "ThrowingProperty"}, new string[] {
+ "NonThrowingProperty"}, IsForeignKey=true)]
public AttributeThrowingEntity ThrowingAssociation
{
get
@@ -375,7 +376,9 @@ public AttributeThrowingEntity ThrowingAssociation
//
// - An exception occurred generating the 'ThrowingEntityAssociationCollectionAttributeProperty' property on attribute of type 'TestDomainServices.ThrowingEntityAssociationCollectionAttribute'.
//
- [Association("AssociationCollection", "NonThrowingProperty", "ThrowingProperty")]
+ [EntityAssociation("AssociationCollection", new string[] {
+ "NonThrowingProperty"}, new string[] {
+ "ThrowingProperty"})]
public EntityCollection ThrowingAssociationCollection
{
get
diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/AttributeThrowing.g.vb b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/AttributeThrowing.g.vb
index 77f60600d..ccae84cd6 100644
--- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/AttributeThrowing.g.vb
+++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/AttributeThrowing.g.vb
@@ -1,7 +1,6 @@
'------------------------------------------------------------------------------
'
' This code was generated by a tool.
-' Runtime Version:4.0.30319.34209
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
@@ -333,7 +332,7 @@ Namespace TestDomainServices
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property ThrowingAssociation() As AttributeThrowingEntity
Get
If (Me._throwingAssociation Is Nothing) Then
@@ -363,7 +362,7 @@ Namespace TestDomainServices
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property ThrowingAssociationCollection() As EntityCollection(Of AttributeThrowingEntity)
Get
If (Me._throwingAssociationCollection Is Nothing) Then
diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/CompositionInheritanceScenarios.g.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/CompositionInheritanceScenarios.g.cs
index 553dd8cad..27301b9eb 100644
--- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/CompositionInheritanceScenarios.g.cs
+++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/CompositionInheritanceScenarios.g.cs
@@ -1,7 +1,6 @@
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
-// Runtime Version:4.0.30319.34209
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -152,7 +151,9 @@ public AI_DetailDerived1()
///
/// Gets or sets the associated entity.
///
- [Association("Master_to_Derived1_Many", "MasterID", "ID", IsForeignKey=true)]
+ [EntityAssociation("Master_to_Derived1_Many", new string[] {
+ "MasterID"}, new string[] {
+ "ID"}, IsForeignKey=true)]
public AI_MasterDerived Master
{
get
@@ -229,7 +230,9 @@ public AI_DetailDerived2()
///
/// Gets or sets the associated entity.
///
- [Association("Master_to_Derived2_Many", "MasterID", "ID", IsForeignKey=true)]
+ [EntityAssociation("Master_to_Derived2_Many", new string[] {
+ "MasterID"}, new string[] {
+ "ID"}, IsForeignKey=true)]
public AI_MasterDerived Master
{
get
@@ -306,7 +309,9 @@ public AI_DetailDerived3()
///
/// Gets or sets the associated entity.
///
- [Association("Master_to_Derived3_One", "MasterID", "ID", IsForeignKey=true)]
+ [EntityAssociation("Master_to_Derived3_One", new string[] {
+ "MasterID"}, new string[] {
+ "ID"}, IsForeignKey=true)]
public AI_MasterDerived Master
{
get
@@ -383,7 +388,9 @@ public AI_DetailDerived4()
///
/// Gets or sets the associated entity.
///
- [Association("Master_to_Derived4_One", "MasterID", "ID", IsForeignKey=true)]
+ [EntityAssociation("Master_to_Derived4_One", new string[] {
+ "MasterID"}, new string[] {
+ "ID"}, IsForeignKey=true)]
public AI_MasterDerived Master
{
get
@@ -533,7 +540,9 @@ public AI_MasterDerived()
///
/// Gets the collection of associated entity instances.
///
- [Association("Master_to_Derived1_Many", "ID", "MasterID")]
+ [EntityAssociation("Master_to_Derived1_Many", new string[] {
+ "ID"}, new string[] {
+ "MasterID"})]
public EntityCollection DetailDerived1s
{
get
@@ -549,7 +558,9 @@ public EntityCollection DetailDerived1s
///
/// Gets the collection of associated entity instances.
///
- [Association("Master_to_Derived2_Many", "ID", "MasterID")]
+ [EntityAssociation("Master_to_Derived2_Many", new string[] {
+ "ID"}, new string[] {
+ "MasterID"})]
public EntityCollection DetailDerived2s
{
get
@@ -565,7 +576,9 @@ public EntityCollection DetailDerived2s
///
/// Gets or sets the associated entity.
///
- [Association("Master_to_Derived3_One", "ID", "MasterID")]
+ [EntityAssociation("Master_to_Derived3_One", new string[] {
+ "ID"}, new string[] {
+ "MasterID"})]
public AI_DetailDerived3 DetailDerived3
{
get
@@ -600,7 +613,9 @@ public AI_DetailDerived3 DetailDerived3
///
/// Gets or sets the associated entity.
///
- [Association("Master_to_Derived4_One", "ID", "MasterID")]
+ [EntityAssociation("Master_to_Derived4_One", new string[] {
+ "ID"}, new string[] {
+ "MasterID"})]
public AI_DetailDerived4 DetailDerived4
{
get
@@ -1030,7 +1045,9 @@ public string OperationResult
///
/// Gets or sets the associated entity.
///
- [Association("Child_Parent", "ParentID", "ID", IsForeignKey=true)]
+ [EntityAssociation("Child_Parent", new string[] {
+ "ParentID"}, new string[] {
+ "ID"}, IsForeignKey=true)]
public CI_Parent Parent
{
get
@@ -1215,8 +1232,10 @@ public CI_Parent()
///
/// Gets the collection of associated entity instances.
///
- [Association("Child_Parent", "ID", "ParentID")]
[Composition()]
+ [EntityAssociation("Child_Parent", new string[] {
+ "ID"}, new string[] {
+ "ParentID"})]
public EntityCollection Children
{
get
diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/CompositionInheritanceScenarios.g.vb b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/CompositionInheritanceScenarios.g.vb
index 2adc85ef1..f2a854d18 100644
--- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/CompositionInheritanceScenarios.g.vb
+++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/CompositionInheritanceScenarios.g.vb
@@ -1,7 +1,6 @@
'------------------------------------------------------------------------------
'
' This code was generated by a tool.
-' Runtime Version:4.0.30319.34209
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
@@ -155,7 +154,7 @@ Namespace TestDomainServices
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Master() As AI_MasterDerived
Get
If (Me._master Is Nothing) Then
@@ -222,7 +221,7 @@ Namespace TestDomainServices
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Master() As AI_MasterDerived
Get
If (Me._master Is Nothing) Then
@@ -289,7 +288,7 @@ Namespace TestDomainServices
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Master() As AI_MasterDerived
Get
If (Me._master Is Nothing) Then
@@ -356,7 +355,7 @@ Namespace TestDomainServices
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Master() As AI_MasterDerived
Get
If (Me._master Is Nothing) Then
@@ -495,7 +494,7 @@ Namespace TestDomainServices
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property DetailDerived1s() As EntityCollection(Of AI_DetailDerived1)
Get
If (Me._detailDerived1s Is Nothing) Then
@@ -508,7 +507,7 @@ Namespace TestDomainServices
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property DetailDerived2s() As EntityCollection(Of AI_DetailDerived2)
Get
If (Me._detailDerived2s Is Nothing) Then
@@ -521,7 +520,7 @@ Namespace TestDomainServices
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property DetailDerived3() As AI_DetailDerived3
Get
If (Me._detailDerived3 Is Nothing) Then
@@ -549,7 +548,7 @@ Namespace TestDomainServices
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property DetailDerived4() As AI_DetailDerived4
Get
If (Me._detailDerived4 Is Nothing) Then
@@ -955,7 +954,7 @@ Namespace TestDomainServices
'''
''' Gets or sets the associated entity.
'''
- _
+ _
Public Property Parent() As CI_Parent
Get
If (Me._parent Is Nothing) Then
@@ -1125,8 +1124,8 @@ Namespace TestDomainServices
'''
''' Gets the collection of associated entity instances.
'''
- _
+ _
Public ReadOnly Property Children() As EntityCollection(Of CI_Child)
Get
If (Me._children Is Nothing) Then
diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/CompositionScenarios.g.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/CompositionScenarios.g.cs
index 46bf1bf17..a9f2faa90 100644
--- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/CompositionScenarios.g.cs
+++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/CompositionScenarios.g.cs
@@ -1,7 +1,6 @@
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
-// Runtime Version:4.0.30319.34209
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -74,8 +73,10 @@ public Child()
///