Beispiel #1
0
 public static IMemberConfiguration <T, TMember> Attribute <T, TMember>(
     this IMemberConfiguration <T, TMember> @this, Func <TMember, bool> when)
 {
     @this.Root.With <MemberFormatExtension>()
     .Specifications[((ISource <MemberInfo>)@this).Get()] =
         new AttributeSpecification(new DelegatedSpecification <TMember>(when).Adapt());
     return(@this.Attribute());
 }
Beispiel #2
0
 public static IMemberConfiguration <T, TMember> Identity <T, TMember>(this IMemberConfiguration <T, TMember> @this)
 {
     @this.Attribute().Root
     .EnableReferences()
     .With <ReferencesExtension>()
     .Assign(@this.Parent.AsValid <ITypeConfigurationContext>()
             .Get(), ((ISource <MemberInfo>)@this).Get());
     return(@this);
 }
 /// <summary>
 /// Flags the provided member configuration as the identity member for the container's references.  Once an identity
 /// member is established, it is used to emit its unique value and to later read it during deserialization.  The
 /// unique value is used to keep track of references in a different application and/or domain context from when the
 /// original serialization occurred.
 /// </summary>
 /// <typeparam name="T">The containing type of the member.</typeparam>
 /// <typeparam name="TMember">The member's value type.</typeparam>
 /// <param name="this">The member configuration to configure.</param>
 /// <returns>The configured member configuration.</returns>
 public static IMemberConfiguration <T, TMember> Identity <T, TMember>(this IMemberConfiguration <T, TMember> @this)
 => @this.Attribute()
 .Root.EnableRootReferences()
 .With <ReferencesExtension>()
 .Apply(@this.Parent.AsValid <ITypeConfigurationContext>().Get(), @this.GetMember())
 .Return(@this);