private void Write(ConcreteNavigationAccessorProperty property) { WriteDeclaration(property); using (_builder.IndentBraced) { _("get"); using (_builder.IndentBraced) { _("return this.{0};", property.FieldName); } _("set"); using (_builder.IndentBraced) { _("if (this.{0} != value)", property.FieldName); using (_builder.IndentBraced) { _("this.{0} = value;", property.FieldName); _("if (Context != null && Context.GetEntityDescriptor(this) != null && (value == null || Context.GetEntityDescriptor(value) != null))"); using (_builder.IndentBraced) { _("Context.SetLink(this, \"{0}\", value);", property.ModelName); } } } } }
public static ConcreteNavigationAccessorProperty AsNavigationAccessorProperty(OdcmProperty odcmProperty) { return(odcmProperty.IsCollection ? ConcreteNavigationCollectionAccessorProperty.ForConcrete(odcmProperty) : ConcreteNavigationAccessorProperty.ForConcrete(odcmProperty)); }