Esempio n. 1
0
        private void WriteForeignKeyCollections()
        {
            var listType = "IList<";

            if (IsEntityFramework())
            {
                listType = "ICollection<";
            }
            foreach (var foreignKey in _table.ForeignKeyChildren)
            {
                if (foreignKey.IsManyToManyTable() && IsCodeFirst())
                {
                    WriteManyToManyCollection(foreignKey);
                    continue;
                }

                if (_codeWriterSettings.CodeTarget == CodeTarget.PocoRiaServices)
                {
                    _cb.AppendLine("[Include]");
                }
                var propertyName = _codeWriterSettings.NameCollection(foreignKey.NetName);
                var dataType     = listType + foreignKey.NetName + ">";
                _cb.AppendAutomaticCollectionProperty(dataType, propertyName, IsNHibernate());
            }
        }
Esempio n. 2
0
 private void WriteForeignKeyChild(string propertyName, string dataType)
 {
     if (_codeWriterSettings.CodeTarget == CodeTarget.PocoRiaServices)
     {
         _cb.AppendLine("[Include]");
     }
     _cb.AppendAutomaticCollectionProperty(dataType, propertyName, IsNHibernate());
 }
Esempio n. 3
0
 private void WriteForeignKeyChild(string propertyName, string dataType)
 {
     if (codeWriterSettings.CodeTarget == CodeTarget.PocoRiaServices)
     {
         classBuilder.AppendLine("[Include]");
     }
     classBuilder.AppendAutomaticCollectionProperty(dataType, propertyName, false);
 }