//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using DslModeling = global::Microsoft.VisualStudio.Modeling;
using DslDesign = global::Microsoft.VisualStudio.Modeling.Design;
namespace Microsoft.Data.Entity.Design.EntityDesigner.ViewModel
{
	/// <summary>
	/// DomainRelationship EntityTypeHasProperties
	/// </summary>
	[DslDesign::DisplayNameResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties.DisplayName", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
	[DslDesign::DescriptionResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties.Description", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
	[DslModeling::DomainModelOwner(typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel))]
	[DslModeling::DomainRelationship(IsEmbedding=true)]
	[DslModeling::DomainObjectId("c48c6a47-40b2-4e85-a889-b0df52a37f3e")]
	internal partial class EntityTypeHasProperties : DslModeling::ElementLink
	{
		#region Constructors, domain class Id
		
		/// <summary>
		/// EntityTypeHasProperties domain class Id.
		/// </summary>
		public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0xc48c6a47, 0x40b2, 0x4e85, 0xa8, 0x89, 0xb0, 0xdf, 0x52, 0xa3, 0x7f, 0x3e);
	
				
		/// <summary>
		/// Constructor
		/// Creates a EntityTypeHasProperties link in the same Partition as the given EntityType
		/// </summary>
		/// <param name="source">EntityType to use as the source of the relationship.</param>
		/// <param name="target">Property to use as the target of the relationship.</param>
		internal EntityTypeHasProperties(EntityType source, Property target)
			: base((source != null ? source.Partition : null), new DslModeling::RoleAssignment[]{new DslModeling::RoleAssignment(EntityTypeHasProperties.EntityTypeDomainRoleId, source), new DslModeling::RoleAssignment(EntityTypeHasProperties.PropertyDomainRoleId, target)}, null)
		{
		}
		
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="store">Store where new link is to be created.</param>
		/// <param name="roleAssignments">List of relationship role assignments.</param>
		public EntityTypeHasProperties(DslModeling::Store store, params DslModeling::RoleAssignment[] roleAssignments)
			: base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, null)
		{
		}
		
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="store">Store where new link is to be created.</param>
		/// <param name="roleAssignments">List of relationship role assignments.</param>
		/// <param name="propertyAssignments">List of properties assignments to set on the new link.</param>
		public EntityTypeHasProperties(DslModeling::Store store, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments)
			: base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, propertyAssignments)
		{
		}
		
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="partition">Partition where new link is to be created.</param>
		/// <param name="roleAssignments">List of relationship role assignments.</param>
		public EntityTypeHasProperties(DslModeling::Partition partition, params DslModeling::RoleAssignment[] roleAssignments)
			: base(partition, roleAssignments, null)
		{
		}
		
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="partition">Partition where new link is to be created.</param>
		/// <param name="roleAssignments">List of relationship role assignments.</param>
		/// <param name="propertyAssignments">List of properties assignments to set on the new link.</param>
		public EntityTypeHasProperties(DslModeling::Partition partition, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments)
			: base(partition, roleAssignments, propertyAssignments)
		{
		}
		#endregion
		#region EntityType domain role code
		
		/// <summary>
		/// EntityType domain role Id.
		/// </summary>
		public static readonly global::System.Guid EntityTypeDomainRoleId = new global::System.Guid(0x30e974ac, 0x5354, 0x45d4, 0x80, 0x45, 0x8b, 0x72, 0x5f, 0xd6, 0x5e, 0xcf);
		
		/// <summary>
		/// DomainRole EntityType
		/// Description for
		/// Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties.EntityType
		/// </summary>
		[DslDesign::DisplayNameResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties/EntityType.DisplayName", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
		[DslDesign::DescriptionResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties/EntityType.Description", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
		[global::System.ComponentModel.Browsable(false)]
		[DslModeling::DomainRole(DslModeling::DomainRoleOrder.Source, PropertyName = "Properties", PropertyDisplayNameKey="Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties/EntityType.PropertyDisplayName",  PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.ZeroMany)]
		[DslModeling::DomainObjectId("30e974ac-5354-45d4-8045-8b725fd65ecf")]
		internal virtual EntityType EntityType
		{
			[global::System.Diagnostics.DebuggerStepThrough]
			get
			{
				return (EntityType)DslModeling::DomainRoleInfo.GetRolePlayer(this, EntityTypeDomainRoleId);
			}
			[global::System.Diagnostics.DebuggerStepThrough]
			set
			{
				DslModeling::DomainRoleInfo.SetRolePlayer(this, EntityTypeDomainRoleId, value);
			}
		}
				
		#endregion
		#region Static methods to access EntityType of a Property
		/// <summary>
		/// Gets EntityType.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static EntityType GetEntityType(Property element)
		{
			return DslModeling::DomainRoleInfo.GetLinkedElement(element, PropertyDomainRoleId) as EntityType;
		}
		
		/// <summary>
		/// Sets EntityType.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static void SetEntityType(Property element, EntityType newEntityType)
		{
			DslModeling::DomainRoleInfo.SetLinkedElement(element, PropertyDomainRoleId, newEntityType);
		}
		#endregion
		#region Property domain role code
		
		/// <summary>
		/// Property domain role Id.
		/// </summary>
		public static readonly global::System.Guid PropertyDomainRoleId = new global::System.Guid(0x9b6fd932, 0xcfcc, 0x47a7, 0x81, 0x08, 0x15, 0x50, 0x0f, 0x9d, 0xd1, 0xfc);
		
		/// <summary>
		/// DomainRole Property
		/// Description for
		/// Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties.Property
		/// </summary>
		[DslDesign::DisplayNameResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties/Property.DisplayName", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
		[DslDesign::DescriptionResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties/Property.Description", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
		[global::System.ComponentModel.Browsable(false)]
		[DslModeling::DomainRole(DslModeling::DomainRoleOrder.Target, PropertyName = "EntityType", PropertyDisplayNameKey="Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties/Property.PropertyDisplayName", PropagatesDelete = true,  PropagatesCopy = DslModeling::PropagatesCopyOption.PropagatesCopyToLinkAndOppositeRolePlayer, Multiplicity = DslModeling::Multiplicity.One)]
		[DslModeling::DomainObjectId("9b6fd932-cfcc-47a7-8108-15500f9dd1fc")]
		internal virtual Property Property
		{
			[global::System.Diagnostics.DebuggerStepThrough]
			get
			{
				return (Property)DslModeling::DomainRoleInfo.GetRolePlayer(this, PropertyDomainRoleId);
			}
			[global::System.Diagnostics.DebuggerStepThrough]
			set
			{
				DslModeling::DomainRoleInfo.SetRolePlayer(this, PropertyDomainRoleId, value);
			}
		}
				
		#endregion
		#region Static methods to access Properties of a EntityType
		/// <summary>
		/// Gets a list of Properties.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static DslModeling::LinkedElementCollection<Property> GetProperties(EntityType element)
		{
			return GetRoleCollection<DslModeling::LinkedElementCollection<Property>, Property>(element, EntityTypeDomainRoleId);
		}
		#endregion
		#region EntityType link accessor
		/// <summary>
		/// Get the list of EntityTypeHasProperties links to a EntityType.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties> GetLinksToProperties ( global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType entityTypeInstance )
		{
			return DslModeling::DomainRoleInfo.GetElementLinks<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties>(entityTypeInstance, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties.EntityTypeDomainRoleId);
		}
		#endregion
		#region Property link accessor
		/// <summary>
		/// Get the EntityTypeHasProperties link to a Property.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties GetLinkToEntityType (global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Property propertyInstance)
		{
			global::System.Collections.Generic.IList<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties>(propertyInstance, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties.PropertyDomainRoleId);
			global::System.Diagnostics.Debug.Assert(links.Count <= 1, "Multiplicity of Property not obeyed.");
			if ( links.Count == 0 )
			{
				return null;
			}
			else
			{
				return links[0];
			}
		}
		#endregion
		#region EntityTypeHasProperties instance accessors
		
		/// <summary>
		/// Get any EntityTypeHasProperties links between a given EntityType and a Property.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties> GetLinks( global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType source, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Property target )
		{
			global::System.Collections.Generic.List<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties> outLinks = new global::System.Collections.Generic.List<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties>();
			global::System.Collections.Generic.IList<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties>(source, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties.EntityTypeDomainRoleId);
			foreach ( global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties link in links )
			{
				if ( target.Equals(link.Property) )
				{
					outLinks.Add(link);
				}
			}
			return outLinks.AsReadOnly();
		}
		/// <summary>
		/// Get the one EntityTypeHasProperties link between a given EntityTypeand a Property.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties GetLink( global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType source, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Property target )
		{
			global::System.Collections.Generic.IList<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties>(source, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties.EntityTypeDomainRoleId);
			foreach ( global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasProperties link in links )
			{
				if ( target.Equals(link.Property) )
				{
					return link;
				}
			}
			return null;
		}
		
		#endregion
	}
}
namespace Microsoft.Data.Entity.Design.EntityDesigner
{
	/// <summary>
	/// DomainRelationship EntityDesignerViewModelHasEntityTypes
	/// Description for
	/// Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes
	/// </summary>
	[DslDesign::DisplayNameResource("Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes.DisplayName", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
	[DslDesign::DescriptionResource("Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes.Description", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
	[DslModeling::DomainModelOwner(typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel))]
	[DslModeling::DomainRelationship(IsEmbedding=true)]
	[DslModeling::DomainObjectId("e3036261-bd10-4be9-8121-53e95b66e582")]
	internal partial class EntityDesignerViewModelHasEntityTypes : DslModeling::ElementLink
	{
		#region Constructors, domain class Id
		
		/// <summary>
		/// EntityDesignerViewModelHasEntityTypes domain class Id.
		/// </summary>
		public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0xe3036261, 0xbd10, 0x4be9, 0x81, 0x21, 0x53, 0xe9, 0x5b, 0x66, 0xe5, 0x82);
	
				
		/// <summary>
		/// Constructor
		/// Creates a EntityDesignerViewModelHasEntityTypes link in the same Partition as the given EntityDesignerViewModel
		/// </summary>
		/// <param name="source">EntityDesignerViewModel to use as the source of the relationship.</param>
		/// <param name="target">EntityType to use as the target of the relationship.</param>
		internal EntityDesignerViewModelHasEntityTypes(global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityDesignerViewModel source, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType target)
			: base((source != null ? source.Partition : null), new DslModeling::RoleAssignment[]{new DslModeling::RoleAssignment(EntityDesignerViewModelHasEntityTypes.EntityDesignerViewModelDomainRoleId, source), new DslModeling::RoleAssignment(EntityDesignerViewModelHasEntityTypes.EntityTypeDomainRoleId, target)}, null)
		{
		}
		
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="store">Store where new link is to be created.</param>
		/// <param name="roleAssignments">List of relationship role assignments.</param>
		public EntityDesignerViewModelHasEntityTypes(DslModeling::Store store, params DslModeling::RoleAssignment[] roleAssignments)
			: base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, null)
		{
		}
		
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="store">Store where new link is to be created.</param>
		/// <param name="roleAssignments">List of relationship role assignments.</param>
		/// <param name="propertyAssignments">List of properties assignments to set on the new link.</param>
		public EntityDesignerViewModelHasEntityTypes(DslModeling::Store store, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments)
			: base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, propertyAssignments)
		{
		}
		
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="partition">Partition where new link is to be created.</param>
		/// <param name="roleAssignments">List of relationship role assignments.</param>
		public EntityDesignerViewModelHasEntityTypes(DslModeling::Partition partition, params DslModeling::RoleAssignment[] roleAssignments)
			: base(partition, roleAssignments, null)
		{
		}
		
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="partition">Partition where new link is to be created.</param>
		/// <param name="roleAssignments">List of relationship role assignments.</param>
		/// <param name="propertyAssignments">List of properties assignments to set on the new link.</param>
		public EntityDesignerViewModelHasEntityTypes(DslModeling::Partition partition, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments)
			: base(partition, roleAssignments, propertyAssignments)
		{
		}
		#endregion
		#region EntityDesignerViewModel domain role code
		
		/// <summary>
		/// EntityDesignerViewModel domain role Id.
		/// </summary>
		public static readonly global::System.Guid EntityDesignerViewModelDomainRoleId = new global::System.Guid(0xdd4caca7, 0x8da5, 0x48eb, 0xba, 0x33, 0xb0, 0x06, 0xb2, 0x39, 0x3f, 0x22);
		
		/// <summary>
		/// DomainRole EntityDesignerViewModel
		/// Description for
		/// Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes.EntityDesignerViewModel
		/// </summary>
		[DslDesign::DisplayNameResource("Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes/EntityDesignerViewModel.DisplayName", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
		[DslDesign::DescriptionResource("Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes/EntityDesignerViewModel.Description", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
		[global::System.ComponentModel.Browsable(false)]
		[DslModeling::DomainRole(DslModeling::DomainRoleOrder.Source, PropertyName = "EntityTypes", PropertyDisplayNameKey="Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes/EntityDesignerViewModel.PropertyDisplayName",  PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.ZeroMany)]
		[DslModeling::DomainObjectId("dd4caca7-8da5-48eb-ba33-b006b2393f22")]
		internal virtual global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityDesignerViewModel EntityDesignerViewModel
		{
			[global::System.Diagnostics.DebuggerStepThrough]
			get
			{
				return (global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityDesignerViewModel)DslModeling::DomainRoleInfo.GetRolePlayer(this, EntityDesignerViewModelDomainRoleId);
			}
			[global::System.Diagnostics.DebuggerStepThrough]
			set
			{
				DslModeling::DomainRoleInfo.SetRolePlayer(this, EntityDesignerViewModelDomainRoleId, value);
			}
		}
				
		#endregion
		#region Static methods to access EntityDesignerViewModel of a EntityType
		/// <summary>
		/// Gets EntityDesignerViewModel.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityDesignerViewModel GetEntityDesignerViewModel(global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType element)
		{
			return DslModeling::DomainRoleInfo.GetLinkedElement(element, EntityTypeDomainRoleId) as global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityDesignerViewModel;
		}
		
		/// <summary>
		/// Sets EntityDesignerViewModel.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static void SetEntityDesignerViewModel(global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType element, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityDesignerViewModel newEntityDesignerViewModel)
		{
			DslModeling::DomainRoleInfo.SetLinkedElement(element, EntityTypeDomainRoleId, newEntityDesignerViewModel);
		}
		#endregion
		#region EntityType domain role code
		
		/// <summary>
		/// EntityType domain role Id.
		/// </summary>
		public static readonly global::System.Guid EntityTypeDomainRoleId = new global::System.Guid(0xfe5a70fc, 0x12dd, 0x438d, 0x81, 0x3b, 0x8f, 0xe2, 0xad, 0x58, 0x56, 0x7f);
		
		/// <summary>
		/// DomainRole EntityType
		/// Description for
		/// Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes.EntityType
		/// </summary>
		[DslDesign::DisplayNameResource("Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes/EntityType.DisplayName", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
		[DslDesign::DescriptionResource("Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes/EntityType.Description", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
		[global::System.ComponentModel.Browsable(false)]
		[DslModeling::DomainRole(DslModeling::DomainRoleOrder.Target, PropertyName = "EntityDesignerViewModel", PropertyDisplayNameKey="Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes/EntityType.PropertyDisplayName", PropagatesDelete = true,  PropagatesCopy = DslModeling::PropagatesCopyOption.PropagatesCopyToLinkAndOppositeRolePlayer, Multiplicity = DslModeling::Multiplicity.One)]
		[DslModeling::DomainObjectId("fe5a70fc-12dd-438d-813b-8fe2ad58567f")]
		internal virtual global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType EntityType
		{
			[global::System.Diagnostics.DebuggerStepThrough]
			get
			{
				return (global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType)DslModeling::DomainRoleInfo.GetRolePlayer(this, EntityTypeDomainRoleId);
			}
			[global::System.Diagnostics.DebuggerStepThrough]
			set
			{
				DslModeling::DomainRoleInfo.SetRolePlayer(this, EntityTypeDomainRoleId, value);
			}
		}
				
		#endregion
		#region Static methods to access EntityTypes of a EntityDesignerViewModel
		/// <summary>
		/// Gets a list of EntityTypes.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static DslModeling::LinkedElementCollection<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType> GetEntityTypes(global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityDesignerViewModel element)
		{
			return GetRoleCollection<DslModeling::LinkedElementCollection<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType>, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType>(element, EntityDesignerViewModelDomainRoleId);
		}
		#endregion
		#region EntityDesignerViewModel link accessor
		/// <summary>
		/// Get the list of EntityDesignerViewModelHasEntityTypes links to a EntityDesignerViewModel.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes> GetLinksToEntityTypes ( global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityDesignerViewModel entityDesignerViewModelInstance )
		{
			return DslModeling::DomainRoleInfo.GetElementLinks<global::Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes>(entityDesignerViewModelInstance, global::Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes.EntityDesignerViewModelDomainRoleId);
		}
		#endregion
		#region EntityType link accessor
		/// <summary>
		/// Get the EntityDesignerViewModelHasEntityTypes link to a EntityType.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static global::Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes GetLinkToEntityDesignerViewModel (global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType entityTypeInstance)
		{
			global::System.Collections.Generic.IList<global::Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes>(entityTypeInstance, global::Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes.EntityTypeDomainRoleId);
			global::System.Diagnostics.Debug.Assert(links.Count <= 1, "Multiplicity of EntityType not obeyed.");
			if ( links.Count == 0 )
			{
				return null;
			}
			else
			{
				return links[0];
			}
		}
		#endregion
		#region EntityDesignerViewModelHasEntityTypes instance accessors
		
		/// <summary>
		/// Get any EntityDesignerViewModelHasEntityTypes links between a given EntityDesignerViewModel and a EntityType.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes> GetLinks( global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityDesignerViewModel source, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType target )
		{
			global::System.Collections.Generic.List<global::Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes> outLinks = new global::System.Collections.Generic.List<global::Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes>();
			global::System.Collections.Generic.IList<global::Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes>(source, global::Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes.EntityDesignerViewModelDomainRoleId);
			foreach ( global::Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes link in links )
			{
				if ( target.Equals(link.EntityType) )
				{
					outLinks.Add(link);
				}
			}
			return outLinks.AsReadOnly();
		}
		/// <summary>
		/// Get the one EntityDesignerViewModelHasEntityTypes link between a given EntityDesignerViewModeland a EntityType.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static global::Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes GetLink( global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityDesignerViewModel source, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType target )
		{
			global::System.Collections.Generic.IList<global::Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes>(source, global::Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes.EntityDesignerViewModelDomainRoleId);
			foreach ( global::Microsoft.Data.Entity.Design.EntityDesigner.EntityDesignerViewModelHasEntityTypes link in links )
			{
				if ( target.Equals(link.EntityType) )
				{
					return link;
				}
			}
			return null;
		}
		
		#endregion
	}
}
namespace Microsoft.Data.Entity.Design.EntityDesigner.ViewModel
{
	/// <summary>
	/// DomainRelationship Association
	/// </summary>
	[System.ComponentModel.TypeDescriptionProvider(typeof(AssociationDescriptionProvider))]
	[DslDesign::DisplayNameResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association.DisplayName", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
	[DslDesign::DescriptionResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association.Description", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
	[DslModeling::DomainModelOwner(typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel))]
	[global::System.Diagnostics.DebuggerDisplay("{GetType().Name,nq} (Name = {namePropertyStorage})")]
	[DslModeling::DomainRelationship(AllowsDuplicates = true)]
	[DslModeling::DomainObjectId("f9cc6d75-f51d-447a-bd83-fba56fed8b44")]
	internal partial class Association : DslModeling::ElementLink
	{
		#region Constructors, domain class Id
		
		/// <summary>
		/// Association domain class Id.
		/// </summary>
		public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0xf9cc6d75, 0xf51d, 0x447a, 0xbd, 0x83, 0xfb, 0xa5, 0x6f, 0xed, 0x8b, 0x44);
	
				
		/// <summary>
		/// Constructor
		/// Creates a Association link in the same Partition as the given EntityType
		/// </summary>
		/// <param name="source">EntityType to use as the source of the relationship.</param>
		/// <param name="target">EntityType to use as the target of the relationship.</param>
		internal Association(EntityType source, EntityType target)
			: base((source != null ? source.Partition : null), new DslModeling::RoleAssignment[]{new DslModeling::RoleAssignment(Association.SourceEntityTypeDomainRoleId, source), new DslModeling::RoleAssignment(Association.TargetEntityTypeDomainRoleId, target)}, null)
		{
		}
		
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="store">Store where new link is to be created.</param>
		/// <param name="roleAssignments">List of relationship role assignments.</param>
		public Association(DslModeling::Store store, params DslModeling::RoleAssignment[] roleAssignments)
			: base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, null)
		{
		}
		
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="store">Store where new link is to be created.</param>
		/// <param name="roleAssignments">List of relationship role assignments.</param>
		/// <param name="propertyAssignments">List of properties assignments to set on the new link.</param>
		public Association(DslModeling::Store store, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments)
			: base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, propertyAssignments)
		{
		}
		
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="partition">Partition where new link is to be created.</param>
		/// <param name="roleAssignments">List of relationship role assignments.</param>
		public Association(DslModeling::Partition partition, params DslModeling::RoleAssignment[] roleAssignments)
			: base(partition, roleAssignments, null)
		{
		}
		
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="partition">Partition where new link is to be created.</param>
		/// <param name="roleAssignments">List of relationship role assignments.</param>
		/// <param name="propertyAssignments">List of properties assignments to set on the new link.</param>
		public Association(DslModeling::Partition partition, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments)
			: base(partition, roleAssignments, propertyAssignments)
		{
		}
		#endregion
		#region SourceEntityType domain role code
		
		/// <summary>
		/// SourceEntityType domain role Id.
		/// </summary>
		public static readonly global::System.Guid SourceEntityTypeDomainRoleId = new global::System.Guid(0xb4225a71, 0x8c58, 0x4bde, 0x82, 0xa7, 0x1e, 0xbd, 0xfb, 0x15, 0xa3, 0x73);
		
		/// <summary>
		/// DomainRole SourceEntityType
		/// Description for
		/// Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association.SourceEntityType
		/// </summary>
		[DslDesign::DisplayNameResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association/SourceEntityType.DisplayName", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
		[DslDesign::DescriptionResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association/SourceEntityType.Description", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
		[global::System.ComponentModel.Browsable(false)]
		[DslModeling::DomainRole(DslModeling::DomainRoleOrder.Source, PropertyName = "AssociationTargets", PropertyDisplayNameKey="Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association/SourceEntityType.PropertyDisplayName",  PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.ZeroMany)]
		[DslModeling::DomainObjectId("b4225a71-8c58-4bde-82a7-1ebdfb15a373")]
		internal virtual EntityType SourceEntityType
		{
			[global::System.Diagnostics.DebuggerStepThrough]
			get
			{
				return (EntityType)DslModeling::DomainRoleInfo.GetRolePlayer(this, SourceEntityTypeDomainRoleId);
			}
			[global::System.Diagnostics.DebuggerStepThrough]
			set
			{
				DslModeling::DomainRoleInfo.SetRolePlayer(this, SourceEntityTypeDomainRoleId, value);
			}
		}
				
		#endregion
		#region Static methods to access AssociationSources of a EntityType
		/// <summary>
		/// Gets a list of AssociationSources.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static DslModeling::LinkedElementCollection<EntityType> GetAssociationSources(EntityType element)
		{
			return GetRoleCollection<DslModeling::LinkedElementCollection<EntityType>, EntityType>(element, TargetEntityTypeDomainRoleId);
		}
		#endregion
		#region TargetEntityType domain role code
		
		/// <summary>
		/// TargetEntityType domain role Id.
		/// </summary>
		public static readonly global::System.Guid TargetEntityTypeDomainRoleId = new global::System.Guid(0x45245da1, 0xb4fc, 0x4879, 0x8a, 0x59, 0xc2, 0x25, 0xe2, 0x33, 0xbd, 0xfe);
		
		/// <summary>
		/// DomainRole TargetEntityType
		/// Description for
		/// Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association.TargetEntityType
		/// </summary>
		[DslDesign::DisplayNameResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association/TargetEntityType.DisplayName", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
		[DslDesign::DescriptionResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association/TargetEntityType.Description", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
		[global::System.ComponentModel.Browsable(false)]
		[DslModeling::DomainRole(DslModeling::DomainRoleOrder.Target, PropertyName = "AssociationSources", PropertyDisplayNameKey="Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association/TargetEntityType.PropertyDisplayName",  PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.ZeroMany)]
		[DslModeling::DomainObjectId("45245da1-b4fc-4879-8a59-c225e233bdfe")]
		internal virtual EntityType TargetEntityType
		{
			[global::System.Diagnostics.DebuggerStepThrough]
			get
			{
				return (EntityType)DslModeling::DomainRoleInfo.GetRolePlayer(this, TargetEntityTypeDomainRoleId);
			}
			[global::System.Diagnostics.DebuggerStepThrough]
			set
			{
				DslModeling::DomainRoleInfo.SetRolePlayer(this, TargetEntityTypeDomainRoleId, value);
			}
		}
				
		#endregion
		#region Static methods to access AssociationTargets of a EntityType
		/// <summary>
		/// Gets a list of AssociationTargets.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static DslModeling::LinkedElementCollection<EntityType> GetAssociationTargets(EntityType element)
		{
			return GetRoleCollection<DslModeling::LinkedElementCollection<EntityType>, EntityType>(element, SourceEntityTypeDomainRoleId);
		}
		#endregion
		#region Name domain property code
		
		/// <summary>
		/// Name domain property Id.
		/// </summary>
		public static readonly global::System.Guid NameDomainPropertyId = new global::System.Guid(0x39e88f59, 0xc849, 0x4810, 0x8b, 0x9e, 0xb9, 0xe0, 0x79, 0x8d, 0x97, 0x9b);
		
		/// <summary>
		/// Storage for Name
		/// </summary>
		private global::System.String namePropertyStorage = string.Empty;
		
		/// <summary>
		/// Gets or sets the value of Name domain property.
		/// Name
		/// </summary>
		[DslDesign::DisplayNameResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association/Name.DisplayName", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
		[DslDesign::DescriptionResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association/Name.Description", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
		[global::System.ComponentModel.Browsable(false)]
		[DslModeling::ElementName]
		[DslModeling::DomainObjectId("39e88f59-c849-4810-8b9e-b9e0798d979b")]
		public global::System.String Name
		{
			[global::System.Diagnostics.DebuggerStepThrough]
			get
			{
				return namePropertyStorage;
			}
			[global::System.Diagnostics.DebuggerStepThrough]
			set
			{
				NamePropertyHandler.Instance.SetValue(this, value);
			}
		}
		/// <summary>
		/// Value handler for the Association.Name domain property.
		/// </summary>
		internal sealed partial class NamePropertyHandler : DslModeling::DomainPropertyValueHandler<Association, global::System.String>
		{
			private NamePropertyHandler() { }
		
			/// <summary>
			/// Gets the singleton instance of the Association.Name domain property value handler.
			/// </summary>
			public static readonly NamePropertyHandler Instance = new NamePropertyHandler();
		
			/// <summary>
			/// Gets the Id of the Association.Name domain property.
			/// </summary>
			public sealed override global::System.Guid DomainPropertyId
			{
				[global::System.Diagnostics.DebuggerStepThrough]
				get
				{
					return NameDomainPropertyId;
				}
			}
			
			/// <summary>
			/// Gets a strongly-typed value of the property on specified element.
			/// </summary>
			/// <param name="element">Element which owns the property.</param>
			/// <returns>Property value.</returns>
			public override sealed global::System.String GetValue(Association element)
			{
				if (element == null) throw new global::System.ArgumentNullException("element");
				return element.namePropertyStorage;
			}
		
			/// <summary>
			/// Sets property value on an element.
			/// </summary>
			/// <param name="element">Element which owns the property.</param>
			/// <param name="newValue">New property value.</param>
			public override sealed void SetValue(Association element, global::System.String newValue)
			{
				if (element == null) throw new global::System.ArgumentNullException("element");
		
				global::System.String oldValue = GetValue(element);
				if (newValue != oldValue)
				{
					ValueChanging(element, oldValue, newValue);
					element.namePropertyStorage = newValue;
					ValueChanged(element, oldValue, newValue);
				}
			}
		}
		
		#endregion
		#region SourceMultiplicity domain property code
		
		/// <summary>
		/// SourceMultiplicity domain property Id.
		/// </summary>
		public static readonly global::System.Guid SourceMultiplicityDomainPropertyId = new global::System.Guid(0xcb259944, 0x6001, 0x4696, 0x9e, 0xa7, 0x19, 0xa8, 0x04, 0xf2, 0xb2, 0xc1);
		
		/// <summary>
		/// Storage for SourceMultiplicity
		/// </summary>
		private global::System.String sourceMultiplicityPropertyStorage = string.Empty;
		
		/// <summary>
		/// Gets or sets the value of SourceMultiplicity domain property.
		/// Computed source display text
		/// </summary>
		[DslDesign::DisplayNameResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association/SourceMultiplicity.DisplayName", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
		[DslDesign::DescriptionResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association/SourceMultiplicity.Description", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
		[global::System.ComponentModel.Browsable(false)]
		[global::System.ComponentModel.ReadOnly(true)]
		[DslModeling::DomainObjectId("cb259944-6001-4696-9ea7-19a804f2b2c1")]
		public global::System.String SourceMultiplicity
		{
			[global::System.Diagnostics.DebuggerStepThrough]
			get
			{
				return sourceMultiplicityPropertyStorage;
			}
			[global::System.Diagnostics.DebuggerStepThrough]
			set
			{
				SourceMultiplicityPropertyHandler.Instance.SetValue(this, value);
			}
		}
		/// <summary>
		/// Value handler for the Association.SourceMultiplicity domain property.
		/// </summary>
		internal sealed partial class SourceMultiplicityPropertyHandler : DslModeling::DomainPropertyValueHandler<Association, global::System.String>
		{
			private SourceMultiplicityPropertyHandler() { }
		
			/// <summary>
			/// Gets the singleton instance of the Association.SourceMultiplicity domain property value handler.
			/// </summary>
			public static readonly SourceMultiplicityPropertyHandler Instance = new SourceMultiplicityPropertyHandler();
		
			/// <summary>
			/// Gets the Id of the Association.SourceMultiplicity domain property.
			/// </summary>
			public sealed override global::System.Guid DomainPropertyId
			{
				[global::System.Diagnostics.DebuggerStepThrough]
				get
				{
					return SourceMultiplicityDomainPropertyId;
				}
			}
			
			/// <summary>
			/// Gets a strongly-typed value of the property on specified element.
			/// </summary>
			/// <param name="element">Element which owns the property.</param>
			/// <returns>Property value.</returns>
			public override sealed global::System.String GetValue(Association element)
			{
				if (element == null) throw new global::System.ArgumentNullException("element");
				return element.sourceMultiplicityPropertyStorage;
			}
		
			/// <summary>
			/// Sets property value on an element.
			/// </summary>
			/// <param name="element">Element which owns the property.</param>
			/// <param name="newValue">New property value.</param>
			public override sealed void SetValue(Association element, global::System.String newValue)
			{
				if (element == null) throw new global::System.ArgumentNullException("element");
		
				global::System.String oldValue = GetValue(element);
				if (newValue != oldValue)
				{
					ValueChanging(element, oldValue, newValue);
					element.sourceMultiplicityPropertyStorage = newValue;
					ValueChanged(element, oldValue, newValue);
				}
			}
		}
		
		#endregion
		#region TargetMultiplicity domain property code
		
		/// <summary>
		/// TargetMultiplicity domain property Id.
		/// </summary>
		public static readonly global::System.Guid TargetMultiplicityDomainPropertyId = new global::System.Guid(0x141f87f4, 0x9156, 0x4a6f, 0xa5, 0xc8, 0x7f, 0x64, 0xf4, 0xdf, 0x69, 0xc8);
		
		/// <summary>
		/// Storage for TargetMultiplicity
		/// </summary>
		private global::System.String targetMultiplicityPropertyStorage = string.Empty;
		
		/// <summary>
		/// Gets or sets the value of TargetMultiplicity domain property.
		/// Computed target display text
		/// </summary>
		[DslDesign::DisplayNameResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association/TargetMultiplicity.DisplayName", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
		[DslDesign::DescriptionResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association/TargetMultiplicity.Description", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
		[global::System.ComponentModel.Browsable(false)]
		[global::System.ComponentModel.ReadOnly(true)]
		[DslModeling::DomainObjectId("141f87f4-9156-4a6f-a5c8-7f64f4df69c8")]
		public global::System.String TargetMultiplicity
		{
			[global::System.Diagnostics.DebuggerStepThrough]
			get
			{
				return targetMultiplicityPropertyStorage;
			}
			[global::System.Diagnostics.DebuggerStepThrough]
			set
			{
				TargetMultiplicityPropertyHandler.Instance.SetValue(this, value);
			}
		}
		/// <summary>
		/// Value handler for the Association.TargetMultiplicity domain property.
		/// </summary>
		internal sealed partial class TargetMultiplicityPropertyHandler : DslModeling::DomainPropertyValueHandler<Association, global::System.String>
		{
			private TargetMultiplicityPropertyHandler() { }
		
			/// <summary>
			/// Gets the singleton instance of the Association.TargetMultiplicity domain property value handler.
			/// </summary>
			public static readonly TargetMultiplicityPropertyHandler Instance = new TargetMultiplicityPropertyHandler();
		
			/// <summary>
			/// Gets the Id of the Association.TargetMultiplicity domain property.
			/// </summary>
			public sealed override global::System.Guid DomainPropertyId
			{
				[global::System.Diagnostics.DebuggerStepThrough]
				get
				{
					return TargetMultiplicityDomainPropertyId;
				}
			}
			
			/// <summary>
			/// Gets a strongly-typed value of the property on specified element.
			/// </summary>
			/// <param name="element">Element which owns the property.</param>
			/// <returns>Property value.</returns>
			public override sealed global::System.String GetValue(Association element)
			{
				if (element == null) throw new global::System.ArgumentNullException("element");
				return element.targetMultiplicityPropertyStorage;
			}
		
			/// <summary>
			/// Sets property value on an element.
			/// </summary>
			/// <param name="element">Element which owns the property.</param>
			/// <param name="newValue">New property value.</param>
			public override sealed void SetValue(Association element, global::System.String newValue)
			{
				if (element == null) throw new global::System.ArgumentNullException("element");
		
				global::System.String oldValue = GetValue(element);
				if (newValue != oldValue)
				{
					ValueChanging(element, oldValue, newValue);
					element.targetMultiplicityPropertyStorage = newValue;
					ValueChanged(element, oldValue, newValue);
				}
			}
		}
		
		#endregion
		#region SourceEntityType link accessor
		/// <summary>
		/// Get the list of Association links to a EntityType.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association> GetLinksToAssociationTargets ( global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType sourceEntityTypeInstance )
		{
			return DslModeling::DomainRoleInfo.GetElementLinks<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association>(sourceEntityTypeInstance, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association.SourceEntityTypeDomainRoleId);
		}
		#endregion
		#region TargetEntityType link accessor
		/// <summary>
		/// Get the list of Association links to a EntityType.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association> GetLinksToAssociationSources ( global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType targetEntityTypeInstance )
		{
			return DslModeling::DomainRoleInfo.GetElementLinks<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association>(targetEntityTypeInstance, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association.TargetEntityTypeDomainRoleId);
		}
		#endregion
		#region Association instance accessors
		
		/// <summary>
		/// Get any Association links between a given EntityType and a EntityType.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association> GetLinks( global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType source, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType target )
		{
			global::System.Collections.Generic.List<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association> outLinks = new global::System.Collections.Generic.List<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association>();
			global::System.Collections.Generic.IList<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association>(source, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association.SourceEntityTypeDomainRoleId);
			foreach ( global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association link in links )
			{
				if ( target.Equals(link.TargetEntityType) )
				{
					outLinks.Add(link);
				}
			}
			return outLinks.AsReadOnly();
		}
		#endregion
	}
}
namespace Microsoft.Data.Entity.Design.EntityDesigner.ViewModel
{
	/// <summary>
	/// DomainRelationship EntityTypeHasNavigationProperties
	/// </summary>
	[DslDesign::DisplayNameResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties.DisplayName", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
	[DslDesign::DescriptionResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties.Description", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
	[DslModeling::DomainModelOwner(typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel))]
	[DslModeling::DomainRelationship(IsEmbedding=true)]
	[DslModeling::DomainObjectId("81514557-7408-48c9-b3cd-cee5d27efe6e")]
	internal partial class EntityTypeHasNavigationProperties : DslModeling::ElementLink
	{
		#region Constructors, domain class Id
		
		/// <summary>
		/// EntityTypeHasNavigationProperties domain class Id.
		/// </summary>
		public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0x81514557, 0x7408, 0x48c9, 0xb3, 0xcd, 0xce, 0xe5, 0xd2, 0x7e, 0xfe, 0x6e);
	
				
		/// <summary>
		/// Constructor
		/// Creates a EntityTypeHasNavigationProperties link in the same Partition as the given EntityType
		/// </summary>
		/// <param name="source">EntityType to use as the source of the relationship.</param>
		/// <param name="target">NavigationProperty to use as the target of the relationship.</param>
		internal EntityTypeHasNavigationProperties(EntityType source, NavigationProperty target)
			: base((source != null ? source.Partition : null), new DslModeling::RoleAssignment[]{new DslModeling::RoleAssignment(EntityTypeHasNavigationProperties.EntityTypeDomainRoleId, source), new DslModeling::RoleAssignment(EntityTypeHasNavigationProperties.NavigationPropertyDomainRoleId, target)}, null)
		{
		}
		
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="store">Store where new link is to be created.</param>
		/// <param name="roleAssignments">List of relationship role assignments.</param>
		public EntityTypeHasNavigationProperties(DslModeling::Store store, params DslModeling::RoleAssignment[] roleAssignments)
			: base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, null)
		{
		}
		
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="store">Store where new link is to be created.</param>
		/// <param name="roleAssignments">List of relationship role assignments.</param>
		/// <param name="propertyAssignments">List of properties assignments to set on the new link.</param>
		public EntityTypeHasNavigationProperties(DslModeling::Store store, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments)
			: base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, propertyAssignments)
		{
		}
		
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="partition">Partition where new link is to be created.</param>
		/// <param name="roleAssignments">List of relationship role assignments.</param>
		public EntityTypeHasNavigationProperties(DslModeling::Partition partition, params DslModeling::RoleAssignment[] roleAssignments)
			: base(partition, roleAssignments, null)
		{
		}
		
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="partition">Partition where new link is to be created.</param>
		/// <param name="roleAssignments">List of relationship role assignments.</param>
		/// <param name="propertyAssignments">List of properties assignments to set on the new link.</param>
		public EntityTypeHasNavigationProperties(DslModeling::Partition partition, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments)
			: base(partition, roleAssignments, propertyAssignments)
		{
		}
		#endregion
		#region EntityType domain role code
		
		/// <summary>
		/// EntityType domain role Id.
		/// </summary>
		public static readonly global::System.Guid EntityTypeDomainRoleId = new global::System.Guid(0x573dadad, 0x1cf6, 0x491b, 0xa6, 0x74, 0x00, 0xcf, 0x97, 0x91, 0x0b, 0xbd);
		
		/// <summary>
		/// DomainRole EntityType
		/// Description for
		/// Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties.EntityType
		/// </summary>
		[DslDesign::DisplayNameResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties/EntityType.DisplayName", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
		[DslDesign::DescriptionResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties/EntityType.Description", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
		[global::System.ComponentModel.Browsable(false)]
		[DslModeling::DomainRole(DslModeling::DomainRoleOrder.Source, PropertyName = "NavigationProperties", PropertyDisplayNameKey="Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties/EntityType.PropertyDisplayName",  PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.ZeroMany)]
		[DslModeling::DomainObjectId("573dadad-1cf6-491b-a674-00cf97910bbd")]
		internal virtual EntityType EntityType
		{
			[global::System.Diagnostics.DebuggerStepThrough]
			get
			{
				return (EntityType)DslModeling::DomainRoleInfo.GetRolePlayer(this, EntityTypeDomainRoleId);
			}
			[global::System.Diagnostics.DebuggerStepThrough]
			set
			{
				DslModeling::DomainRoleInfo.SetRolePlayer(this, EntityTypeDomainRoleId, value);
			}
		}
				
		#endregion
		#region Static methods to access EntityType of a NavigationProperty
		/// <summary>
		/// Gets EntityType.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static EntityType GetEntityType(NavigationProperty element)
		{
			return DslModeling::DomainRoleInfo.GetLinkedElement(element, NavigationPropertyDomainRoleId) as EntityType;
		}
		
		/// <summary>
		/// Sets EntityType.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static void SetEntityType(NavigationProperty element, EntityType newEntityType)
		{
			DslModeling::DomainRoleInfo.SetLinkedElement(element, NavigationPropertyDomainRoleId, newEntityType);
		}
		#endregion
		#region NavigationProperty domain role code
		
		/// <summary>
		/// NavigationProperty domain role Id.
		/// </summary>
		public static readonly global::System.Guid NavigationPropertyDomainRoleId = new global::System.Guid(0x7309dfe7, 0x8356, 0x46f3, 0x95, 0x2e, 0x16, 0x50, 0x09, 0xef, 0xaf, 0xe6);
		
		/// <summary>
		/// DomainRole NavigationProperty
		/// Description for
		/// Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties.NavigationProperty
		/// </summary>
		[DslDesign::DisplayNameResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties/NavigationProperty.DisplayName", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
		[DslDesign::DescriptionResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties/NavigationProperty.Description", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
		[global::System.ComponentModel.Browsable(false)]
		[DslModeling::DomainRole(DslModeling::DomainRoleOrder.Target, PropertyName = "EntityType", PropertyDisplayNameKey="Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties/NavigationProperty.PropertyDisplayName", PropagatesDelete = true,  PropagatesCopy = DslModeling::PropagatesCopyOption.PropagatesCopyToLinkAndOppositeRolePlayer, Multiplicity = DslModeling::Multiplicity.One)]
		[DslModeling::DomainObjectId("7309dfe7-8356-46f3-952e-165009efafe6")]
		internal virtual NavigationProperty NavigationProperty
		{
			[global::System.Diagnostics.DebuggerStepThrough]
			get
			{
				return (NavigationProperty)DslModeling::DomainRoleInfo.GetRolePlayer(this, NavigationPropertyDomainRoleId);
			}
			[global::System.Diagnostics.DebuggerStepThrough]
			set
			{
				DslModeling::DomainRoleInfo.SetRolePlayer(this, NavigationPropertyDomainRoleId, value);
			}
		}
				
		#endregion
		#region Static methods to access NavigationProperties of a EntityType
		/// <summary>
		/// Gets a list of NavigationProperties.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static DslModeling::LinkedElementCollection<NavigationProperty> GetNavigationProperties(EntityType element)
		{
			return GetRoleCollection<DslModeling::LinkedElementCollection<NavigationProperty>, NavigationProperty>(element, EntityTypeDomainRoleId);
		}
		#endregion
		#region EntityType link accessor
		/// <summary>
		/// Get the list of EntityTypeHasNavigationProperties links to a EntityType.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties> GetLinksToNavigationProperties ( global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType entityTypeInstance )
		{
			return DslModeling::DomainRoleInfo.GetElementLinks<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties>(entityTypeInstance, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties.EntityTypeDomainRoleId);
		}
		#endregion
		#region NavigationProperty link accessor
		/// <summary>
		/// Get the EntityTypeHasNavigationProperties link to a NavigationProperty.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties GetLinkToEntityType (global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.NavigationProperty navigationPropertyInstance)
		{
			global::System.Collections.Generic.IList<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties>(navigationPropertyInstance, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties.NavigationPropertyDomainRoleId);
			global::System.Diagnostics.Debug.Assert(links.Count <= 1, "Multiplicity of NavigationProperty not obeyed.");
			if ( links.Count == 0 )
			{
				return null;
			}
			else
			{
				return links[0];
			}
		}
		#endregion
		#region EntityTypeHasNavigationProperties instance accessors
		
		/// <summary>
		/// Get any EntityTypeHasNavigationProperties links between a given EntityType and a NavigationProperty.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties> GetLinks( global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType source, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.NavigationProperty target )
		{
			global::System.Collections.Generic.List<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties> outLinks = new global::System.Collections.Generic.List<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties>();
			global::System.Collections.Generic.IList<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties>(source, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties.EntityTypeDomainRoleId);
			foreach ( global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties link in links )
			{
				if ( target.Equals(link.NavigationProperty) )
				{
					outLinks.Add(link);
				}
			}
			return outLinks.AsReadOnly();
		}
		/// <summary>
		/// Get the one EntityTypeHasNavigationProperties link between a given EntityTypeand a NavigationProperty.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties GetLink( global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType source, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.NavigationProperty target )
		{
			global::System.Collections.Generic.IList<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties>(source, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties.EntityTypeDomainRoleId);
			foreach ( global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties link in links )
			{
				if ( target.Equals(link.NavigationProperty) )
				{
					return link;
				}
			}
			return null;
		}
		
		#endregion
	}
}
namespace Microsoft.Data.Entity.Design.EntityDesigner.ViewModel
{
	/// <summary>
	/// DomainRelationship Inheritance
	/// </summary>
	[DslDesign::DisplayNameResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance.DisplayName", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
	[DslDesign::DescriptionResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance.Description", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
	[DslModeling::DomainModelOwner(typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel))]
	[DslModeling::DomainRelationship()]
	[DslModeling::DomainObjectId("9f7eeb7a-4385-41d3-8c3e-c99fe852eb38")]
	internal partial class Inheritance : DslModeling::ElementLink
	{
		#region Constructors, domain class Id
		
		/// <summary>
		/// Inheritance domain class Id.
		/// </summary>
		public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0x9f7eeb7a, 0x4385, 0x41d3, 0x8c, 0x3e, 0xc9, 0x9f, 0xe8, 0x52, 0xeb, 0x38);
	
				
		/// <summary>
		/// Constructor
		/// Creates a Inheritance link in the same Partition as the given EntityType
		/// </summary>
		/// <param name="source">EntityType to use as the source of the relationship.</param>
		/// <param name="target">EntityType to use as the target of the relationship.</param>
		internal Inheritance(EntityType source, EntityType target)
			: base((source != null ? source.Partition : null), new DslModeling::RoleAssignment[]{new DslModeling::RoleAssignment(Inheritance.SourceEntityTypeDomainRoleId, source), new DslModeling::RoleAssignment(Inheritance.TargetEntityTypeDomainRoleId, target)}, null)
		{
		}
		
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="store">Store where new link is to be created.</param>
		/// <param name="roleAssignments">List of relationship role assignments.</param>
		public Inheritance(DslModeling::Store store, params DslModeling::RoleAssignment[] roleAssignments)
			: base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, null)
		{
		}
		
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="store">Store where new link is to be created.</param>
		/// <param name="roleAssignments">List of relationship role assignments.</param>
		/// <param name="propertyAssignments">List of properties assignments to set on the new link.</param>
		public Inheritance(DslModeling::Store store, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments)
			: base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, propertyAssignments)
		{
		}
		
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="partition">Partition where new link is to be created.</param>
		/// <param name="roleAssignments">List of relationship role assignments.</param>
		public Inheritance(DslModeling::Partition partition, params DslModeling::RoleAssignment[] roleAssignments)
			: base(partition, roleAssignments, null)
		{
		}
		
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="partition">Partition where new link is to be created.</param>
		/// <param name="roleAssignments">List of relationship role assignments.</param>
		/// <param name="propertyAssignments">List of properties assignments to set on the new link.</param>
		public Inheritance(DslModeling::Partition partition, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments)
			: base(partition, roleAssignments, propertyAssignments)
		{
		}
		#endregion
		#region SourceEntityType domain role code
		
		/// <summary>
		/// SourceEntityType domain role Id.
		/// </summary>
		public static readonly global::System.Guid SourceEntityTypeDomainRoleId = new global::System.Guid(0xce879f7d, 0x559d, 0x48a6, 0x81, 0x4f, 0x31, 0x57, 0xa4, 0xc3, 0x9b, 0xbc);
		
		/// <summary>
		/// DomainRole SourceEntityType
		/// Description for
		/// Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance.SourceEntityType
		/// </summary>
		[DslDesign::DisplayNameResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance/SourceEntityType.DisplayName", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
		[DslDesign::DescriptionResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance/SourceEntityType.Description", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
		[global::System.ComponentModel.Browsable(false)]
		[DslModeling::DomainRole(DslModeling::DomainRoleOrder.Source, PropertyName = "DerivedTypes", PropertyDisplayNameKey="Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance/SourceEntityType.PropertyDisplayName",  PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.ZeroMany)]
		[DslModeling::DomainObjectId("ce879f7d-559d-48a6-814f-3157a4c39bbc")]
		internal virtual EntityType SourceEntityType
		{
			[global::System.Diagnostics.DebuggerStepThrough]
			get
			{
				return (EntityType)DslModeling::DomainRoleInfo.GetRolePlayer(this, SourceEntityTypeDomainRoleId);
			}
			[global::System.Diagnostics.DebuggerStepThrough]
			set
			{
				DslModeling::DomainRoleInfo.SetRolePlayer(this, SourceEntityTypeDomainRoleId, value);
			}
		}
				
		#endregion
		#region Static methods to access BaseType of a EntityType
		/// <summary>
		/// Gets BaseType.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static EntityType GetBaseType(EntityType element)
		{
			return DslModeling::DomainRoleInfo.GetLinkedElement(element, TargetEntityTypeDomainRoleId) as EntityType;
		}
		
		/// <summary>
		/// Sets BaseType.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static void SetBaseType(EntityType element, EntityType newSourceEntityType)
		{
			DslModeling::DomainRoleInfo.SetLinkedElement(element, TargetEntityTypeDomainRoleId, newSourceEntityType);
		}
		#endregion
		#region TargetEntityType domain role code
		
		/// <summary>
		/// TargetEntityType domain role Id.
		/// </summary>
		public static readonly global::System.Guid TargetEntityTypeDomainRoleId = new global::System.Guid(0x1483ad20, 0x8271, 0x4cb4, 0xb7, 0xc5, 0xa0, 0xa2, 0x1e, 0x13, 0xa6, 0x9d);
		
		/// <summary>
		/// DomainRole TargetEntityType
		/// Description for
		/// Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance.TargetEntityType
		/// </summary>
		[DslDesign::DisplayNameResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance/TargetEntityType.DisplayName", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
		[DslDesign::DescriptionResource("Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance/TargetEntityType.Description", typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel), "Microsoft.Data.Entity.Design.EntityDesigner.GeneratedCode.DomainModelResx")]
		[global::System.ComponentModel.Browsable(false)]
		[DslModeling::DomainRole(DslModeling::DomainRoleOrder.Target, PropertyName = "BaseType", PropertyDisplayNameKey="Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance/TargetEntityType.PropertyDisplayName",  PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.ZeroOne)]
		[DslModeling::DomainObjectId("1483ad20-8271-4cb4-b7c5-a0a21e13a69d")]
		internal virtual EntityType TargetEntityType
		{
			[global::System.Diagnostics.DebuggerStepThrough]
			get
			{
				return (EntityType)DslModeling::DomainRoleInfo.GetRolePlayer(this, TargetEntityTypeDomainRoleId);
			}
			[global::System.Diagnostics.DebuggerStepThrough]
			set
			{
				DslModeling::DomainRoleInfo.SetRolePlayer(this, TargetEntityTypeDomainRoleId, value);
			}
		}
				
		#endregion
		#region Static methods to access DerivedTypes of a EntityType
		/// <summary>
		/// Gets a list of DerivedTypes.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static DslModeling::LinkedElementCollection<EntityType> GetDerivedTypes(EntityType element)
		{
			return GetRoleCollection<DslModeling::LinkedElementCollection<EntityType>, EntityType>(element, SourceEntityTypeDomainRoleId);
		}
		#endregion
		#region SourceEntityType link accessor
		/// <summary>
		/// Get the list of Inheritance links to a EntityType.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance> GetLinksToDerivedTypes ( global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType sourceEntityTypeInstance )
		{
			return DslModeling::DomainRoleInfo.GetElementLinks<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance>(sourceEntityTypeInstance, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance.SourceEntityTypeDomainRoleId);
		}
		#endregion
		#region TargetEntityType link accessor
		/// <summary>
		/// Get the Inheritance link to a EntityType.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance GetLinkToBaseType (global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType targetEntityTypeInstance)
		{
			global::System.Collections.Generic.IList<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance>(targetEntityTypeInstance, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance.TargetEntityTypeDomainRoleId);
			global::System.Diagnostics.Debug.Assert(links.Count <= 1, "Multiplicity of TargetEntityType not obeyed.");
			if ( links.Count == 0 )
			{
				return null;
			}
			else
			{
				return links[0];
			}
		}
		#endregion
		#region Inheritance instance accessors
		
		/// <summary>
		/// Get any Inheritance links between a given EntityType and a EntityType.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static global::System.Collections.ObjectModel.ReadOnlyCollection<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance> GetLinks( global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType source, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType target )
		{
			global::System.Collections.Generic.List<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance> outLinks = new global::System.Collections.Generic.List<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance>();
			global::System.Collections.Generic.IList<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance>(source, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance.SourceEntityTypeDomainRoleId);
			foreach ( global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance link in links )
			{
				if ( target.Equals(link.TargetEntityType) )
				{
					outLinks.Add(link);
				}
			}
			return outLinks.AsReadOnly();
		}
		/// <summary>
		/// Get the one Inheritance link between a given EntityTypeand a EntityType.
		/// </summary>
		[global::System.Diagnostics.DebuggerStepThrough]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
		internal static global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance GetLink( global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType source, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType target )
		{
			global::System.Collections.Generic.IList<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance> links = DslModeling::DomainRoleInfo.GetElementLinks<global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance>(source, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance.SourceEntityTypeDomainRoleId);
			foreach ( global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Inheritance link in links )
			{
				if ( target.Equals(link.TargetEntityType) )
				{
					return link;
				}
			}
			return null;
		}
		
		#endregion
	}
}
