-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
148 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
src/Content/Backend/Query/.template.config/dotnetcli.host.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/dotnetcli.host", | ||
"symbolInfo": { | ||
"queryName": { | ||
"longName": "queryName", | ||
"shortName": "qn" | ||
}, | ||
"returnType": { | ||
"longName": "returnType", | ||
"shortName": "rt" | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/vs-2017.3.host", | ||
"icon": "icon.png", | ||
"unsupportedHosts": [], | ||
"symbolInfo": [ | ||
{ | ||
"id": "queryName", | ||
"name": { | ||
"text": "Query name" | ||
}, | ||
"isVisible": true | ||
}, | ||
{ | ||
"id": "returnType", | ||
"name": { | ||
"text": "Return type" | ||
}, | ||
"isVisible": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/template", | ||
"author": "One Beyond", | ||
"classifications": [ "Common", "Code" ], | ||
"name": "Monaco Query Template", | ||
"identity": "Monaco.Template.Backend.Solution.Query", | ||
"shortName": "monaco-backend-query", | ||
"sourceName": "MyFeature", | ||
"tags": { | ||
"language": "C#", | ||
"type": "item" | ||
}, | ||
"symbols": { | ||
"applicationProjectNamespace": { | ||
"type": "bind", | ||
"binding": "msbuild:RootNamespace", | ||
"replaces": "ProjectName", | ||
"defaultValue": "MyProjectNamespace" | ||
}, | ||
"solutionName": { | ||
"type": "derived", | ||
"valueSource": "applicationProjectNamespace", | ||
"valueTransform": "ValueAfterLastDot" | ||
}, | ||
"commonSolutionNamespace": { | ||
"type": "parameter", | ||
"datatype": "text", | ||
"defaultValue": "", | ||
"displayName": "Solution Namespace" | ||
}, | ||
"generatedSolutionNamespace": { | ||
"type": "generated", | ||
"generator": "switch", | ||
//"replaces": "CommonSolutionName", | ||
"parameters": { | ||
"datatype": "text", | ||
"cases": [ | ||
{ | ||
"condition": "(commonSolutionNamespace == '')", | ||
"value": "(solutionName)" | ||
}, | ||
{ | ||
"condition": "(commonSolutionNamespace != '')", | ||
"value": "(commonSolutionNamespace)" | ||
} | ||
] | ||
} | ||
}, | ||
//"derivedSolutionNamespace": { | ||
// "type": "derived", | ||
|
||
//}, | ||
//"generatedSolutionNamespace": { | ||
// "type": "generated", | ||
// "generator": "coalesce", | ||
// "parameters": { | ||
// "sourceVariableName": "commonSolutionNamespace", | ||
// "fallbackVariableName": "solutionName" | ||
// }, | ||
// "replaces": "RootSolutionName" | ||
//}, | ||
"queryName": { | ||
"type": "parameter", | ||
"datatype": "text", | ||
"defaultValue": "GetItemsList", | ||
"displayName": "Query name", | ||
"description": "Name of the Query feature", | ||
"replaces": "GetItemsList", | ||
"fileRename": "GetItemsList" | ||
}, | ||
"returnType": { | ||
"type": "parameter", | ||
"datatype": "text", | ||
"defaultValue": "List<ItemDto>", | ||
"displayName": "Return type", | ||
"description": "Type of the return value", | ||
"replaces": "List<ItemDto>" | ||
} | ||
}, | ||
"forms": { | ||
"ValueAfterLastDot": { | ||
"identifier": "replace", | ||
"pattern": "([.\\w]+\\.)\\w+", // regex to match everything up to and including the final "." | ||
"replacement": "" // replace it with empty string | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using MediatR; | ||
using Microsoft.Extensions.Primitives; | ||
using ProjectName.DTOs; | ||
using ProjectName.DTOs.Extensions; | ||
using ProjectName.Infrastructure.Context; | ||
using CommonSolutionName.Common.Application.Queries; | ||
using CommonSolutionName.Common.Application.Queries.Extensions; | ||
|
||
namespace ProjectName.Features.MyFeature; | ||
|
||
public sealed class GetItemsList | ||
{ | ||
public record Query(IEnumerable<KeyValuePair<string, StringValues>> QueryString) : QueryBase<List<ItemDto>>(QueryString); | ||
|
||
public sealed class Handler : IRequestHandler<Query, List<ItemDto>> | ||
{ | ||
private readonly AppDbContext _dbContext; | ||
|
||
public Handler(AppDbContext dbContext) | ||
{ | ||
_dbContext = dbContext; | ||
} | ||
|
||
public Task<List<ItemDto>> Handle(Query request, CancellationToken cancellationToken) => | ||
throw new NotImplementedException(); | ||
} | ||
} |