mushroom-cli 1.1.0-alpha.23 → 1.1.0-alpha.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/gen/gen-csharp.js +3 -17
- package/package.json +3 -3
package/gen/gen-csharp.js
CHANGED
|
@@ -910,21 +910,6 @@ namespace ${namespace}
|
|
|
910
910
|
{
|
|
911
911
|
${collectionNames}
|
|
912
912
|
public static IMongoDatabase GetDatabase() => Mushroom.MushroomDaoFactory.GetDbAdapter() as IMongoDatabase;
|
|
913
|
-
|
|
914
|
-
public static async System.Threading.Tasks.Task<T> FindByIdAsync<T, TId>(this IMongoCollection<T> collection, TId id) where T : Mushroom.Models.IResource<TId>
|
|
915
|
-
{
|
|
916
|
-
return await (await collection.FindAsync(Builders<T>.Filter.Eq(doc => doc.Id, id))).FirstOrDefaultAsync();
|
|
917
|
-
}
|
|
918
|
-
|
|
919
|
-
public static async System.Threading.Tasks.Task<T> FindByIdAsync<T, TId>(this IMongoCollection<T> collection, TId id, FindOptions<T> findOptions) where T : Mushroom.Models.IResource<TId>
|
|
920
|
-
{
|
|
921
|
-
return await (await collection.FindAsync(Builders<T>.Filter.Eq(doc => doc.Id, id), findOptions)).FirstOrDefaultAsync();
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
public static async System.Threading.Tasks.Task<T> FindByIdAsync<T, TId>(this IMongoCollection<T> collection, TId id, ProjectionDefinition<T> projection) where T : Mushroom.Models.IResource<TId>
|
|
925
|
-
{
|
|
926
|
-
return await (await collection.FindAsync(Builders<T>.Filter.Eq(doc => doc.Id, id), new FindOptions<T> { Projection = projection })).FirstOrDefaultAsync();
|
|
927
|
-
}
|
|
928
913
|
}
|
|
929
914
|
}
|
|
930
915
|
`;
|
|
@@ -933,7 +918,7 @@ ${collectionNames}
|
|
|
933
918
|
|
|
934
919
|
namespace ${namespace}
|
|
935
920
|
{
|
|
936
|
-
public class
|
|
921
|
+
public class ResourceNamess
|
|
937
922
|
{
|
|
938
923
|
private ResourceNames() { }
|
|
939
924
|
|
|
@@ -985,7 +970,8 @@ ${strJobReferences}
|
|
|
985
970
|
#endif
|
|
986
971
|
`;
|
|
987
972
|
|
|
988
|
-
const infoFileContent = `// Mushroom CLI version: ${package.version}${newLine}// Compatible with Mushroom Server version: 0.2.
|
|
973
|
+
const infoFileContent = `// Mushroom CLI version: ${package.version}${newLine}// Compatible with Mushroom Server version: 0.2.25.4 or higher (https://www.nuget.org/packages/Mushroom/)
|
|
974
|
+
// For Mushroom Server 0.2.18 to 0.2.25.4: Please remove all FindById methods in DbConnector.cs`
|
|
989
975
|
|
|
990
976
|
fs.writeFileSync(aliasProject.output + "/DbConnector.cs", dbConnectorFileContent);
|
|
991
977
|
fs.writeFileSync(aliasProject.output + "/ResourceNames.cs", resourceNamesFileContent);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mushroom-cli",
|
|
3
|
-
"version": "1.1.0-alpha.
|
|
3
|
+
"version": "1.1.0-alpha.24",
|
|
4
4
|
"description": "Mushroom CLI",
|
|
5
5
|
"main": "mr.js",
|
|
6
6
|
"scripts": {
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"author": "suco2007",
|
|
18
18
|
"license": "ISC",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"jsdom": "^
|
|
21
|
-
"json5": "^2.2.
|
|
20
|
+
"jsdom": "^21.0.0",
|
|
21
|
+
"json5": "^2.2.3",
|
|
22
22
|
"node-fetch": "^2.6.7",
|
|
23
23
|
"open": "^8.4.0",
|
|
24
24
|
"readline-sync": "^1.4.10",
|