I kind of want to put a high and mighty mysterious quote here to show how important/useful the place is. But I haven't gotten around to that yet.
Anyway. Lets get into it I guess.
JadeScript is an okay language. But it is very much of its time. There's no functional programming, and if you do it yourself, you really pay for it with the cost of indirection & method calls.
And, without C#, you are locked into a quite a few inferior ways of doing things
So. What do we get when we move to C#?
Refer to the DotNetDevRef pdf as well $JadeHome\JADE docs\documentation\DotNetDev.pdf
Start at Chapter 3. Follow through to see the gist of how to do it from Jade, making an application for C# to connect to, the screens involved, how to expose things
"Adding a WPF application" is optional reading. It covers the project refs you have to add, and its in a clunky way where everything is in one big visual studio project.
Those being:
So Jade spits out the files needed to build a class library - something that contains all your C# mapped Jade classes in a nice library file.
In this project, it helps to keep things simple. If you only plan to build a .net 8 app, right click the project file > properties. Under Application > General, there should be Output type of Class Library, and Target frameworks of net4.8;net6.0;net8.0;. You can just change this to net8.0 .
Change the project type from debug to release for slightly faster code (VS defaults to debug)
The joob section does not come with the defaultPoolSize attribute present. It defaults to 10, meaning 10 processes.
You will probably run out of process licenses and not be able to do any C# stuff if your Jade license has less than 10 processes allowed.
Why it doesn't automatically ask and adjust if it runs into this exception is beyond me. I gave this as feedback, but since it's technically in the documentation (and hard as hell to encounter naturally), they don't care
For just starting out until you know you need more, change this to
<joob defaultConnection="myDefault" defaultPoolSize="1">
It is probably easiest to ask an AI for what this should be, depending on what version of dotnet you want to use.
I found that for dotnet 8, this works
<startup> <supportedRuntime version="v8.0" sku=".NETCoreApp,Version=v8.0"/> </startup>
So, jade generates a YourClassesExposure.exe.config file, that you correct manually as shown above, and have to shove into an App.config, that lives in your project folder.
When you create a new JoobContext() for your database conneciton, the default constructor assumes you have some form of System.Configuration.ConfigurationManager installed. Even the overloads use this.
This obviously fails when you haven't installed it yet. Just use the nuget package manager and install whatever the latest version of it is. Jade will resolve and use it.
There are more modern ways to read values out of the config. (appSettings.json, bound to a class c# poco object). I'll have to figure out how to feed it into the constructor eventually.