Beispiel #1
0
        private void Write(FetcherNavigationProperty property)
        {
            WriteDeclaration(property);

            using (_builder.IndentBraced)
            {
                _("get");

                using (_builder.IndentBraced)
                {
                    _("if (this.{0} == null)", property.FieldName);
                    using (_builder.IndentBraced)
                    {
                        _("this.{0} = new {1}();", property.FieldName, property.InstanceType);
                        _("this.{0}.Initialize(this.Context, GetPath(\"{1}\"));", property.FieldName, property.ModelName);
                    }
                    _("");
                    _("return this.{0};", property.FieldName);
                }
            }
        }
Beispiel #2
0
        private void Write(FetcherNavigationProperty property)
        {
            WriteDeclaration(property);

            using (_builder.IndentBraced)
            {
                _("get");

                using (_builder.IndentBraced)
                {
                    _("if (this.{0} == null)", property.FieldName);
                    using (_builder.IndentBraced)
                    {
                        _("this.{0} = new {1}();", property.FieldName, property.InstanceType);
                        _("this.{0}.Initialize(this.Context, GetPath(\"{1}\"));", property.FieldName, property.ModelName);
                    }
                    _("");
                    _("return this.{0};", property.FieldName);
                }
            }
        }
Beispiel #3
0
 public static FetcherNavigationProperty AsIFetcherNavigationPropertyForFetcher(OdcmProperty odcmProperty)
 {
     return(odcmProperty.IsCollection
         ? FetcherNavigationCollectionProperty.ForFetcher(odcmProperty)
         : FetcherNavigationProperty.ForFetcher(odcmProperty));
 }