Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mixin's interface to interface list of child class #13

Closed
pgenfer opened this issue May 13, 2016 · 1 comment
Closed

Add mixin's interface to interface list of child class #13

pgenfer opened this issue May 13, 2016 · 1 comment

Comments

@pgenfer
Copy link
Owner

pgenfer commented May 13, 2016

Remark: Issue #11 was split into two parts for easier administration. This is the first part.

Say I have the following mixin

public class NameMixin: INamed
{
    public string Name { get; set; }
}

and INamed is defined as follows

public interface INamed
{
    string Name { get; set; } = string.Empty;
}

Furthermore, I have the following class

public class Person
{
    NameMixin _name = new NameMixin();
}

When I mix the NameMixin class into my type, I would like the option for the type to be further augmented by having the INamed interface automatically added to its interface list.

Thanks to @aluanhaddad for the suggestion of this feature.

@aluanhaddad
Copy link
Contributor

aluanhaddad commented May 13, 2016

This looks great. I just noticed that my example code which was posted here had a mistake where I had the property initializer in the interface instead of the implementing mixin. I corrected the code in the original post. Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants