-
Notifications
You must be signed in to change notification settings - Fork 27
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
Ability to specify property name casing rules, or a way to match property names #19
Comments
I created PR #21 which allows the user to optionally specify a custom property name mapper. If not specified, the default property name mapper will be used. For example:
It can then be used as follows:
Thank you. |
I've just had this issue today where the automatic property name formatting was causing me problems. I liked the idea suggested above by @icnocop and it would have provided a way of solving my problem (by preserving property names). Therefore, I've pinched a couple of his ideas and created PR #27 that allows a property name formatter to be specified. I'd be grateful if it could be considered for inclusion and for any comments. |
I'd like the ability to specify the property name casing rules, or a way to match property names, because the current convention doesn't create the expected property names.
For example, add the following scenario in
.\Specs\DynamicInstancesFromTable.feature
:And add the following step in
.\Specs\Steps\DynamicInstanceCreationSteps.cs
:Result:
The current convention will create an
ExpandoObject
with the propertyCustomerId
.The issue occurs when I try to assign the properties from the
ExpandoObject
to fields in the database.In my case, the field in the database is
CustomerID
.As a work-around I have to search for the property name without case sensitivity.
The issue can be resolved in two ways.
Add the ability to specify one of the following property name casing rules:
a. Do not change the case
b. Only change the case on the first letter of every word
Since I already have a type with properties I want the property names in the
ExpandoObject
to match with, add the ability to pass the type during the creation of the dynamic instance (using the generic syntax for example).I can't use SpecFlow's built-in support for creating objects because I'm updating entities in a database from the table, and I specify only the fields I want updated in the table.
Thank you.
The text was updated successfully, but these errors were encountered: