Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-94

Structure support

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Feature Request
    • Labels:
      None
    • Environment:
      Win7 x64, latest C# Driver trunk

      I have noticed that latest C# Driver has some failing tests, for structure support.
      I have tried to fix it by myself, but I hit some framework limitations.
      So, here they are, to save your's time:
      1. IL/Expression Setters inside BsonMemberMap are not working for structs, because structs are passed by value (and not by ref)
      2. I have tried to switch setter syntax from Action<object, object> to custom delegate that looks like Action<ref object, object>, but I came across FW limitations

      • Dynamic method (used for IL code) does not support not REF, nor OUT modifiers
      • I haven't found how to use LINQ.Expressions builder, to support REF or OUT modifiers
      • There is a way, to use Func<object, object, object> modifiers, that returns modified struct each time, but IMO it would be painful for GC

            Assignee:
            Unassigned Unassigned
            Reporter:
            valera_kolupaev Valera Kolupaev
            Votes:
            14 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated:
              Resolved: