Some quick changes following standard C# code style we use in Semantic Kernel and Semantic Memory. I added the EditorConfig setting and the standard .gitignore for C# projects, to help with future development.
Changes:
Set namespace to Cloud.Unum.USearch - Feel free to change it, I took the value from Java, hopefully that's the right one you'd like using.
Move USearchException outside of class - I noticed the exception was nested into a class. You can keep it outside and reuse it, with a little bit less code to write for clients, given the FullName is shorter.
Fix format of some parameters, e.g. from snake_case to camelCase. I was tempted to make these adjustments also in NativeMethods but given the class is internal it's ok if you prefer it that way, and I don't have a quick way to test changes to that class, so I'm leaving it to you. In general, in C#, I would avoid snake_case unless it's a requirement for the underlying integration.
Order methods by visibility - Aside from the disposing logic, in C# methods are usually sorted with public methods first, to help with readability, e.g. finding the public methods aka finding the available API.
Add EditorConfig settings - This should help with future development. It's also used by dotnet format.
Add standard .gitignore for .NET projects.
I noticed the folder has two solution files libusearch-wrapper.sln and csharp.sln, not sure why, and they show different views. Looks like csharp.sln is an older one. I would suggest having just one and deleting the other. There seems to be also some outlier C# files like libusearch.cs and test.cs which I ignored.
Some quick changes following standard C# code style we use in Semantic Kernel and Semantic Memory. I added the EditorConfig setting and the standard .gitignore for C# projects, to help with future development.
Changes:
Cloud.Unum.USearch
- Feel free to change it, I took the value from Java, hopefully that's the right one you'd like using.snake_case
tocamelCase
. I was tempted to make these adjustments also inNativeMethods
but given the class is internal it's ok if you prefer it that way, and I don't have a quick way to test changes to that class, so I'm leaving it to you. In general, in C#, I would avoidsnake_case
unless it's a requirement for the underlying integration.dotnet format
.I noticed the folder has two solution files
libusearch-wrapper.sln
andcsharp.sln
, not sure why, and they show different views. Looks likecsharp.sln
is an older one. I would suggest having just one and deleting the other. There seems to be also some outlier C# files likelibusearch.cs
andtest.cs
which I ignored.