Open HeikoAdams opened 4 years ago
This is an example class generated by es studio ViewReturns.zip
Oh shoot, I will fix that tonight, I haven't been testing views, easy fix, sorry about that, watch for a fix tonight hopefully
Okay, I just generated some Views off my Northwind database, both Custom and Generated classes. They are compiling just fine, I can't tell by just looking at the class you gave me what the issue is. Can your provide me with more information?
What kind of information do need/prefer?
Okay, I think I see the issue, for some reason their is a weird capitalization issue going on?
For instance ...
public partial class ViewReturns : EsViewReturns
{
}
Notice the "EsViewReturns" .... this should be "esViewReturns ... (lower case "es").
Looking into it. Your custom class is probably inheriting from "esViewReturns" lower case and thus the compiler errors ....
Did you change the prefix in the EntitySpaces Studio "Settings" => "Naming Conventions" tab by chance?
Did you change the prefix in the EntitySpaces Studio "Settings" => "Naming Conventions" tab by chance?
Yes, because M$ naming conventions require classnames starting with an upper case letter.
Hint: I'm using the fxcop nuget
Hmmm, well then you must make sure your Custom Class is inheriting from the Es version, you might need to manually change your "Custom" class.
Hmmm, well then you must make sure your Custom Class is inheriting from the Es version, you might need to manually change your "Custom" class.
I'll check when I'm back at work tomorrow
Okay, I've checked it and the inheritance is correct.
Can you post a cheesy project showing the compiler error or post the compiler error? I simply cannot reproduce this.
The view-query class itself doesn't compile with compiler error "there is no constructor which accepts 0 arguments"
The class constructor signature is public ViewReturnsQuery(string joinAlias)
but at least public ViewReturnsQuery Query
creates a new query instance by calling this.query = new ViewReturnsQuery();
Okay I figured out that changing line 80 of Generated - Query (C#).est from public <%=source.Query%>(string joinAlias)
to public <%=source.Query%>(string joinAlias = "<%=source.Query%>")
A fix for this is also part of my pull request #13
Version 2019.1.1218.0 of EntitySpaces Studio generates buggy code for view clases.
Every generated view class gets at least a constructor which requires a join alias but the GetDynamicQuery or Query methods of the same generated classes are calling a non existing constructor without parameters.