Ejemplo n.º 1
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="T:System.Object" /> class.
 /// </summary>
 public EntityRelationship(EntityRelationSide from, EntityRelationSide to, bool willCascadeOnDelete, EntityInfo manyToManyTable = null)
 {
     From = from;
     To   = to;
     WillCascadeOnDelete = willCascadeOnDelete;
     ManyToManyTable     = manyToManyTable;
 }
Ejemplo n.º 2
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="T:System.Object" /> class.
 /// </summary>
 public EntityRelationship(EntityRelationSide from, EntityRelationSide to, bool willCascadeOnDelete, EntityInfo manyToManyTable = null)
 {
     From = from;
     To = to;
     WillCascadeOnDelete = willCascadeOnDelete;
     ManyToManyTable = manyToManyTable;
 }
Ejemplo n.º 3
0
 private static void AddNavPropertyToEntity(EntityRelationSide side)
 {
     if (side.IsUndirect)
     {
         return;
     }
     side.Entity.NavigationProperties.Add(side.Property);
     if (side.NavigationType != NavigationType.Many)
     {
         side.Entity.AddProperty(new PropertyInfo(string.Format("Has{0}", side.Property.Name),
                                                  typeof(bool).ToUsageInfo(),
                                                  new PropertyInvokerInfo(string.Format("return !ReferenceEquals({0}, null);", side.Property.Name))));
     }
 }