Beispiel #1
0
    public string BuildXtensiveType(OrmType type, params string[] args)
    {
        if (ActiveDTOStage)
        {
            return(BuildPocoType(type, args));
        }

        return(OrmUtils.BuildXtensiveType(type, args));
    }
Beispiel #2
0
        private string GetReturnTypeValue()
        {
            string result = string.Empty;

            if (this.PersistentTypeHasAssociations == null)
            {
                return(result);
            }

            PersistentType ownerPersistentType = this.PersistentTypeOfNavigationProperty;
            bool           isSource            = this.PersistentTypeHasAssociations.SourcePersistentType == ownerPersistentType;

            PersistentType targetPersistentType = isSource ? this.PersistentTypeHasAssociations.TargetPersistentType : this.PersistentTypeHasAssociations.SourcePersistentType;

            switch (this.Multiplicity)
            {
            case MultiplicityKind.Many:
            {
                result = this.TypedEntitySet == null
                                     ? OrmUtils.BuildXtensiveType(OrmType.EntitySet, targetPersistentType.Name)
                                     : string.Format("{0} ({1})", this.TypedEntitySet.Name,

                                                     OrmUtils.BuildXtensiveType(OrmType.EntitySet,
                                                                                this.TypedEntitySet.ItemType == null
                                                                                    ? string.Empty
                                                                                    : this.TypedEntitySet.ItemType.Name));

                break;
            }

            case MultiplicityKind.ZeroOrOne:
            case MultiplicityKind.One:
            {
                result = string.Format("Instance of {0}", targetPersistentType.Name);
                break;
            }
            }

            return(result);
        }
Beispiel #3
0
 protected override string GetTypeDescriptionValue()
 {
     return(OrmUtils.BuildXtensiveType(OrmType.EntitySet, this.ItemType == null ? "?" : this.ItemType.Name));
 }