-
Notifications
You must be signed in to change notification settings - Fork 717
Type building fixes #394
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
Type building fixes #394
Conversation
…ection parameters.
…s been finished already.
…t null pointer when no odata action parameters are found. This is necessary for CreateRef actions.
…ame names are declared in multiple controllers.
… never being resolved.
|
This is great. It looks to be in the right direction to me. |
…same name for different entity sets. (controllers)
|
Just some quick items:
|
|
Yeah, these should be the final changes for this PR. I'm not sure either, it said I had conflicts even though my branch was up-to-date. Right now I have a static dictionary which increases performance drastically, thought it takes up some memory. The profiler also shows that 98% of time spent is in GetClrType. |
|
Sounds good. I'm trying to get Beta 2 out by EOD. Got some other folks waiting on me. I'll see if I can't figure out what the branch issue here is so we can get it in. The performance stuff can come in the RC. Have a look at: https://github.com/OData/WebApi/blob/feature/netcore/src/Microsoft.AspNet.OData.Shared/Formatter/EdmLibHelpers.cs. Specifically, you probably want to use the annotation API to lookup and set the built-in ClrTypeAnnotation rather than maintain a separate dictionary. |
|
Looks like you have merged in your upstream on a working branch instead of rebasing. Not really a big deal. I'll get this merged. Thanks. |
Various fixes for the type builder.
Attributes that take params parameters would cause a cast exception. The expected type was array, but getting the constructor arguments converts params to a list of CustomAttributeTypedArgument.
Fixed by calling ToArray on the parameter.
Some types that were finished still had dependencies on them. Fixed by checking if the type the property is dependent on is present in the dictionary of generated types.
Building ODataActionParameters types caused a name conflict when actions with the same namespace and name were defined in other controllers. Fixed by passing the controller name and prefixing the typename with it.
Prevent null pointer exception when no ODataActionParameters are found on actions. Having this parameter is not required for actions that take no parameters.
Added support for substituting SingleResult, which is an IQuerable with one element.
Still needs test cases but with these fixes I can use the api explorer without any exceptions on the big OData project I'm working with. If everything seems ok, I'll make some test cases.
I can make some repros if needed, let me know.
It still takes around 8 minutes to generate the api descriptions, and I'll be looking in to that after this has been resolved.