Example #1
0
        private void Write(FetcherNavigationCollectionProperty property)
        {
            WriteDeclaration(property);

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

                using (_builder.IndentBraced)
                {
                    _("if (this.{0} == null)", property.FieldName);
                    using (_builder.IndentBraced)
                    {
                        _("this.{0} = new {1}(\n" +
                          "   Context != null ? Context.CreateQuery<{2}>(GetPath(\"{3}\")) : null,\n" +
                          "   Context,\n" +
                          "   this,\n" +
                          "   GetPath(\"{3}\"));", property.FieldName, property.CollectionType, property.InstanceType,
                          property.ModelName);
                    }
                    _("");
                    _("return this.{0};", property.FieldName);
                }
            }
        }
Example #2
0
        private void Write(FetcherNavigationCollectionProperty property)
        {
            WriteDeclaration(property);

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

                using (_builder.IndentBraced)
                {
                    _("if (this.{0} == null)", property.FieldName);
                    using (_builder.IndentBraced)
                    {
                        _("this.{0} = new {1}(\n" +
                          "   Context != null ? Context.CreateQuery<{2}>(GetPath(\"{3}\")) : null,\n" +
                          "   Context,\n" +
                          "   this,\n" +
                          "   GetPath(\"{3}\"));", property.FieldName, property.CollectionType, property.InstanceType,
                            property.ModelName);
                    }
                    _("");
                    _("return this.{0};", property.FieldName);
                }
            }
        }
Example #3
0
 public static FetcherNavigationProperty AsIFetcherNavigationPropertyForFetcher(OdcmProperty odcmProperty)
 {
     return(odcmProperty.IsCollection
         ? FetcherNavigationCollectionProperty.ForFetcher(odcmProperty)
         : FetcherNavigationProperty.ForFetcher(odcmProperty));
 }