IChildSerializerConfigurable.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* Copyright 2010-2014 MongoDB Inc.
  2. *
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. namespace MongoDB.Bson.Serialization
  16. {
  17. // this interface is public so custom serializers can choose to implement it
  18. // but typically you would choose to implement this interface explicitly
  19. // these methods support forwarding attributes to child serializers and wouldn't normally be public
  20. /// <summary>
  21. /// Represents a serializer that has a child serializer that configuration attributes can be forwarded to.
  22. /// </summary>
  23. public interface IChildSerializerConfigurable
  24. {
  25. /// <summary>
  26. /// Gets the child serializer.
  27. /// </summary>
  28. /// <value>
  29. /// The child serializer.
  30. /// </value>
  31. IBsonSerializer ChildSerializer { get; }
  32. /// <summary>
  33. /// Returns a serializer that has been reconfigured with the specified child serializer.
  34. /// </summary>
  35. /// <param name="childSerializer">The child serializer.</param>
  36. /// <returns>The reconfigured serializer.</returns>
  37. IBsonSerializer WithChildSerializer(IBsonSerializer childSerializer);
  38. }
  39. }