/// <summary> /// Adds a property to the given type declaration based on the given metadata /// </summary> /// <param name="memberProperty">The property's metadata</param> /// <param name="parentClass">The type declaration</param> protected override void DeclareMemberProperty(MemberProperty memberProperty, CodeTypeDeclaration parentClass) { if (memberProperty.IsStream()) { this.DeclareNamedStreamProperty(memberProperty, parentClass); } else { parentClass.AddAutoImplementedProperty(this.GetPropertyType(memberProperty, CodeGenerationTypeUsage.Declaration), memberProperty.Name); } }
/// <summary> /// Adds a property to the given type declaration based on the given metadata /// </summary> /// <param name="memberProperty">The property's metadata</param> /// <param name="parentClass">The type declaration</param> protected override void DeclareMemberProperty(MemberProperty memberProperty, CodeTypeDeclaration parentClass) { if (memberProperty.IsStream()) { this.DeclareNamedStreamProperty(memberProperty, parentClass); } else { this.AddPropertyWithChangeNotification(parentClass, this.GetPropertyType(memberProperty, CodeGenerationTypeUsage.Declaration), memberProperty.Name); } }
/// <summary> /// Returns whether or not the property must be declared in metadata. /// </summary> /// <param name="property">The member property.</param> /// <returns>Whether or not the property must be declared in metadata</returns> public static bool MustBeDeclaredInMetadata(this MemberProperty property) { ExceptionUtilities.CheckArgumentNotNull(property, "property"); return(property.IsPrimaryKey || property.Annotations.OfType <ConcurrencyTokenAnnotation>().Any() || property.PropertyType is CollectionDataType || property.IsStream()); }