private void Write(ConcreteNavigationCollectionAccessorProperty property) { WriteDeclaration(property); using (_builder.IndentBraced) { _("get"); using (_builder.IndentBraced) { _("if (this.{0} == null)", property.FieldName); using (_builder.IndentBraced) { _("this.{0} = new {1}<{2}>();", property.FieldName, new Identifier("global::System.Collections.Generic", "List"), property.InstanceType); } _(""); _("return ({0})this.{1};", property.Type, property.FieldName); } } }
public static ConcreteNavigationAccessorProperty AsNavigationAccessorProperty(OdcmProperty odcmProperty) { return(odcmProperty.IsCollection ? ConcreteNavigationCollectionAccessorProperty.ForConcrete(odcmProperty) : ConcreteNavigationAccessorProperty.ForConcrete(odcmProperty)); }