This project is read-only.
4

Closed

New Version DeepCloning example not working.

description

How to replicate the issue:
Step 1: Download example project
Step 2: open package manager
Step 3: update value injecter
Go to SmartConventionInjection.cs
Find line:
var sourceProps = source.GetProps(); (does not seem to have GetByName implementation....

var sourceProp = sourceProps.GetByName(pair.Key); does not seem
var targetProp = targetProps.GetByName(pair.Value);

The new version of Value Injecter does not seem to compile the faster deeper cloning project. It would be nice if the project was modified to work with the lastest version 3.0.1
http://valueinjecter.codeplex.com/wikipage?title=Faster%20Deep%20Cloning%20using%20SmartConventionInjection%20and%20FastMember&referringTitle=Deep%20Cloning



The compilation error
This used to work on version 2.3.3.0 dll from nugget.

var sourceOfData = GetFoo();
var res = new FooVm().InjectFrom<FastDeepCloneInjection>(sourceOfData);


        Console.Read();
    }
    private static Foo GetFoo()
    {
        var o = new Foo
        {
            Name = "Parent",
            Children = new List<ChildEntity> { new ChildEntity { Name = "deep1" }, new ChildEntity { Name = "deep2" } }

        };
        return o;
    }
}
public class Foo
{
    public string Name { get; set; }
    public string NoConvention { get; set; }
    public ICollection<ChildEntity> Children { get; set; }
}

public class ChildEntity
{
    public string Name { get; set; }
}
public class ChildEntityVm
{
    public string Name { get; set; }
}


public class FooVm
{
    public string Name { get; set; }
    public string NoConvention { get; set; }
    public IList<ChildEntityVm> Children { get; set; }
}
Closed Jul 23, 2015 at 4:40 AM by o

comments

wrote Jul 23, 2015 at 4:40 AM