Skip to content

Generics Map to base class  #29

Open

Description

@tossthekitty
    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

Activity

  1. odelvalle commented on Jun 12, 2016

    @odelvalle
    Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions