public bool Accept(IManyToManyPart target)
        {
            acceptParent = string.IsNullOrEmpty(target.ParentKeyColumn);
            acceptChild = string.IsNullOrEmpty(target.ChildKeyColumn);

            return acceptParent || acceptChild;
        }
        public void Apply(IManyToManyPart target)
        {
            target.WithParentKeyColumn(target.EntityType.Name + "Fk");
            target.WithChildKeyColumn(target.ChildType.Name + "Fk");

            target.WithTableName(GetTablename(target));
        }
        public void Apply(IManyToManyPart target)
        {
            if (acceptParent && target.EntityType != null)
                target.WithParentKeyColumn(GetKeyName(null, target.EntityType));

            if (acceptChild && target.ChildType != null)
                target.WithChildKeyColumn(GetKeyName(null, target.ChildType));
        }
        string GetTablename(IManyToManyPart target)
        {
            string tablename = target.ChildType.Name + target.EntityType.Name;
            if (target.ChildType.Name == "Usuario")
            {
                tablename = target.ChildType.Name + target.EntityType.Name;
                target.Inverse();
            }
            else if (target.EntityType.Name == "Usuario")
            {
                tablename = target.EntityType.Name + target.ChildType.Name;
            }

            target.Cascade.None();

            return tablename;
        }
 public void Apply(IManyToManyPart target)
 {
     target.WithTableName(target.ChildType.Name + "To" + target.EntityType.Name);
 }
 public bool Accept(IManyToManyPart target)
 {
     return string.IsNullOrEmpty(target.TableName);
 }
 public bool Accept(IManyToManyPart target)
 {
     return true;
 }
 public void Apply(IManyToManyPart target) {
     target.WithParentKeyColumn(target.EntityType.Name + "Fk");
     target.WithChildKeyColumn(target.ChildType.Name + "Fk");
     target.Cascade.All();
 }
 public void Apply(IManyToManyPart target)
 {
     target.Cascade.SaveUpdate();
 }
Exemple #10
0
 public bool Accept(IManyToManyPart target)
 {
     return(true);
 }
Exemple #11
0
 public void Apply(IManyToManyPart target)
 {
     target.Cascade.SaveUpdate();
 }