SlapperAutoMapper / Slapper.AutoMapper

Slapper.AutoMapper maps dynamic data to static types. Slap your data into submission!
MIT License
287 stars 76 forks source link

Generics Map to base class #29

Open tossthekitty opened 8 years ago

tossthekitty commented 8 years ago
    public class BaseClass
    {
        public int Id { get; set; }
    }

    public class DerivedClass : BaseClass
    {
        public float MoreData { get; set; }//Dimensions ect. Inventory data
    }

    public class ContainerClass<T> where T : BaseClass
    {
        public IList<T> OrderItems { get; set; }
    }
    public class EnhancedContainerClass : ContainerClass<DerivedClass>
    {
    }

    EnhancedContainerClass enhanced = new EnhancedContainerClass();
    ... slapping generates a class with
        List<BaseClass> 
    where it should generate List<DerivedClass>

This is a stinker for me :(. Any chance you might be able to address this? I LOVE SLAPPER! waltlounsbury@gmail.com

odelvalle commented 8 years ago

@tossthekitty can you see if pull request #38 resolve your problem? Maybe can you include some test..