-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
implement support for inherited properties #50
implement support for inherited properties #50
Conversation
i also added test for new staff. I tried to follow your code style. If you want to change smth i can do it. |
Thanks for the PR.
Perhaps a way to solve these issues could be to have the attribute named An example of how this could work: public class Animal
{
public DateTime DateOfBirth { get; set; }
}
[InheritColumns(DefaultOrder = InheritedColumnOrder.InheritedColumnsLast)]
public class Mammal : Animal
{
public bool CanWalk { get; set; }
}
[InheritColumns] // Defaults to InheritedColumnsFirst
public class Dog : Mammal
{
public string Breed { get; set; }
} The order of the columns here should be: CanWalk, DateOfBirth, Breed. |
…ent ignore inherited columns
…ore inherited columns
…s inherit columns
… class set InheritedColumnsLast
…s set InheritedColumnsLast
Thanks for the feedback. |
In the example Otherwise I agree, the attribute must be there to inherit properties. If the attribute was removed from the |
Yeah you're right. |
Hi. Any updates ? |
…rit = false on InheritColumnsAttribute.cs
This looks very good, thank you! |
Add the ability to generate inherited properties
In order not to break compatibility with previous versions and to allow the user to choose for himself how to act with the properties that are in the base class, the
InheritedColumnsOrdering
attribute was added. You can use it to set 3 types of behavior for inherited properties.IgnoreInheritedProperties
- properties from base class will be igonred. This is default behaviour.StartFromInheritedProperties
- Property generation will start with the properties of the base class.StartFromClassProperties
- Property generation will start from the current class