OData / lab

This repository is for exploring new ideas and developing early prototypes of various OData stacks.
Other
48 stars 59 forks source link

Scaffolding doesn't handle entities with kebab-cased names #52

Open davidMuir opened 7 years ago

davidMuir commented 7 years ago

I'm consuming an OData API where the provider has the following entity as an example, with the namespace changed slightly to hide the providers name.


<EntitySet Name="subject-sets" EntityType="Service.Domain.Models.Projections.SubjectSet">
    <NavigationPropertyBinding Path="Tutor1" Target="staff" />
    <NavigationPropertyBinding Path="Tutor2" Target="staff" />
    <NavigationPropertyBinding Path="Tutor3" Target="staff" />
    <NavigationPropertyBinding Path="Pupil" Target="pupils" />
</EntitySet>

This is scaffolded by the OData Connected Service Extension to the following


[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")]
[global::Microsoft.OData.Client.OriginalNameAttribute("subject-sets")]
public global::Microsoft.OData.Client.DataServiceQuery<global::Service.Domain.Models.Projections.SubjectSet> Subject-sets
{
    get
    {
        if ((this._Subject-sets == null))
        {
            this._Subject-sets = base.CreateQuery<global::Service.Domain.Models.Projections.SubjectSet>("subject-sets");
         }
         return this._Subject-sets;
    }
}

which causes issues.

This should instead be converted to either camel_cased or PascalCased