Skip to content

Support ISet<T> #92

@gbansk

Description

@gbansk

I have found a small issue with some mapping between the source and destination in the following example.

using System;
using AgileObjects.AgileMapper;
using System.Collections.Generic;

public class Program
{
   public class Source
   {
       public List<Child> children { get; set; }

       public Source()
       {
           children = new List<Child>
           {
               new Child {Name = "Mary"},
               new Child { Name = "Joe" },
               new Child { Name = "Jackie" },
               new Child { Name = "John" }
           };


       }
       public ISet<Child> Children()
       {
           return new HashSet<Child>(children);
       }

   }

   public class Destination
   {
       public ISet<Child> Children { get; set; }
   }

   public class Child
   {
       public string Name { get; set; }
   }

   public static void Main()
   {
       var source = new Source();

       var mapped = Mapper.Map(source).ToANew<Destination>();

       //Console.WriteLine(mapped.Name + ", " + mapped.Age + ", " + mapped.Parent.Name);
   }
}

I have worked around it, so this is not a big issue for me.

Thanks,

Gary.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions