Created
April 8, 2019 15:50
-
-
Save samwdp/608ebf57b169cfcb2c6487e380b6b508 to your computer and use it in GitHub Desktop.
Visual Studio Code Settings Sync Gist
This file contains hidden or 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
| {"lastUpload":"2019-04-08T15:50:30.062Z","extensionVersion":"v3.2.8"} |
This file contains hidden or 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
| [ | |
| { | |
| "metadata": { | |
| "id": "850c6bb1-4a81-4f83-a81f-835d651a211c", | |
| "publisherId": "Mikael.Angular-BeastCode", | |
| "publisherDisplayName": "Mikael" | |
| }, | |
| "name": "Angular-BeastCode", | |
| "publisher": "Mikael", | |
| "version": "7.2.6" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "f7d921d1-e720-42be-b9ed-77f01afb05d7", | |
| "publisherId": "schneiderpat.aspnet-helper", | |
| "publisherDisplayName": "schneiderpat" | |
| }, | |
| "name": "aspnet-helper", | |
| "publisher": "schneiderpat", | |
| "version": "0.6.4" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "819a23e1-b6c6-41cf-9029-e653b537d996", | |
| "publisherId": "ms-vscode.azure-account", | |
| "publisherDisplayName": "ms-vscode" | |
| }, | |
| "name": "azure-account", | |
| "publisher": "ms-vscode", | |
| "version": "0.8.1" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "697255a9-3f36-44c8-b084-d3b91edfb23a", | |
| "publisherId": "HookyQR.beautify", | |
| "publisherDisplayName": "HookyQR" | |
| }, | |
| "name": "beautify", | |
| "publisher": "HookyQR", | |
| "version": "1.4.11" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "e337c67b-55c2-4fef-8949-eb260e7fb7fd", | |
| "publisherId": "Shan.code-settings-sync", | |
| "publisherDisplayName": "Shan" | |
| }, | |
| "name": "code-settings-sync", | |
| "publisher": "Shan", | |
| "version": "3.2.8" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "d0bfc4ab-1d3a-4487-8782-7cf6027b4fff", | |
| "publisherId": "ms-vscode.csharp", | |
| "publisherDisplayName": "ms-vscode" | |
| }, | |
| "name": "csharp", | |
| "publisher": "ms-vscode", | |
| "version": "1.18.0" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "94d85ac4-dbcb-42be-9d6a-2e10bb1abdd9", | |
| "publisherId": "rahulsahay.Csharp-ASPNETCore", | |
| "publisherDisplayName": "rahulsahay" | |
| }, | |
| "name": "Csharp-ASPNETCore", | |
| "publisher": "rahulsahay", | |
| "version": "1.0.5" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "e046ec1e-3907-466b-aaea-ff1956a46d27", | |
| "publisherId": "jchannon.csharpextensions", | |
| "publisherDisplayName": "jchannon" | |
| }, | |
| "name": "csharpextensions", | |
| "publisher": "jchannon", | |
| "version": "1.3.0" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "46086a2d-eb85-4f8b-beda-e14570a16f72", | |
| "publisherId": "ms-docfx.DocFX", | |
| "publisherDisplayName": "ms-docfx" | |
| }, | |
| "name": "DocFX", | |
| "publisher": "ms-docfx", | |
| "version": "0.1.3" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "d1a2eab4-aa6e-4094-93b3-6a007f60bd9d", | |
| "publisherId": "k--kato.docomment", | |
| "publisherDisplayName": "k--kato" | |
| }, | |
| "name": "docomment", | |
| "publisher": "k--kato", | |
| "version": "0.1.6" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "99bb976a-1f0e-4644-a31c-16e7da289b09", | |
| "publisherId": "matijarmk.dotnet-core-commands", | |
| "publisherDisplayName": "matijarmk" | |
| }, | |
| "name": "dotnet-core-commands", | |
| "publisher": "matijarmk", | |
| "version": "1.0.6" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "9b2a2971-2be0-4f76-8c04-b0a7ef334eeb", | |
| "publisherId": "KishoreIthadi.dotnet-core-essentials", | |
| "publisherDisplayName": "KishoreIthadi" | |
| }, | |
| "name": "dotnet-core-essentials", | |
| "publisher": "KishoreIthadi", | |
| "version": "0.0.6" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "42853f4f-0c67-4aa7-bb79-a00fec9146c4", | |
| "publisherId": "formulahendry.dotnet-test-explorer", | |
| "publisherDisplayName": "formulahendry" | |
| }, | |
| "name": "dotnet-test-explorer", | |
| "publisher": "formulahendry", | |
| "version": "0.6.6" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "2bba45f2-4a48-41a6-bb86-d6ba5ab29a9f", | |
| "publisherId": "felipecaputo.git-project-manager", | |
| "publisherDisplayName": "felipecaputo" | |
| }, | |
| "name": "git-project-manager", | |
| "publisher": "felipecaputo", | |
| "version": "1.7.1" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "6d2b4ef2-1d6d-4a1f-91fb-29fcadfb4b0a", | |
| "publisherId": "vector-of-bool.gitflow", | |
| "publisherDisplayName": "vector-of-bool" | |
| }, | |
| "name": "gitflow", | |
| "publisher": "vector-of-bool", | |
| "version": "1.2.1" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "5960f38e-0bbe-4644-8f9c-9c8824e82511", | |
| "publisherId": "donjayamanne.githistory", | |
| "publisherDisplayName": "donjayamanne" | |
| }, | |
| "name": "githistory", | |
| "publisher": "donjayamanne", | |
| "version": "0.4.6" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "4de763bd-505d-4978-9575-2b7696ecf94e", | |
| "publisherId": "eamodio.gitlens", | |
| "publisherDisplayName": "eamodio" | |
| }, | |
| "name": "gitlens", | |
| "publisher": "eamodio", | |
| "version": "9.6.0" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "40d39ce9-c381-47a0-80c8-a6661f731eab", | |
| "publisherId": "ms-vscode.powershell", | |
| "publisherDisplayName": "ms-vscode" | |
| }, | |
| "name": "powershell", | |
| "publisher": "ms-vscode", | |
| "version": "1.12.0" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "96fa4707-6983-4489-b7c5-d5ffdfdcce90", | |
| "publisherId": "esbenp.prettier-vscode", | |
| "publisherDisplayName": "esbenp" | |
| }, | |
| "name": "prettier-vscode", | |
| "publisher": "esbenp", | |
| "version": "1.8.1" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "77aa46a2-f495-4398-bd85-bb964c9f429b", | |
| "publisherId": "austincummings.razor-plus", | |
| "publisherDisplayName": "austincummings" | |
| }, | |
| "name": "razor-plus", | |
| "publisher": "austincummings", | |
| "version": "0.1.4" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "50699a99-cc76-4060-a2d2-b927d831e9fa", | |
| "publisherId": "aledev29.razor-snippets-for-asp-net-core", | |
| "publisherDisplayName": "aledev29" | |
| }, | |
| "name": "razor-snippets-for-asp-net-core", | |
| "publisher": "aledev29", | |
| "version": "0.0.3" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "e2c479df-2c90-4915-9015-595ef0d79bd5", | |
| "publisherId": "ms-vsts.team", | |
| "publisherDisplayName": "ms-vsts" | |
| }, | |
| "name": "team", | |
| "publisher": "ms-vsts", | |
| "version": "1.149.2" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "56e317d6-ebcc-4ad8-8c06-ce15949ac200", | |
| "publisherId": "radub.theme-mild", | |
| "publisherDisplayName": "radub" | |
| }, | |
| "name": "theme-mild", | |
| "publisher": "radub", | |
| "version": "0.1.3" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "ce49f801-147f-49b8-9b1b-a8ee3dff91ef", | |
| "publisherId": "slevesque.vscode-autohotkey", | |
| "publisherDisplayName": "slevesque" | |
| }, | |
| "name": "vscode-autohotkey", | |
| "publisher": "slevesque", | |
| "version": "0.2.2" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "42691ca6-18d6-4efe-9e9a-1aabad399d4b", | |
| "publisherId": "ms-azuretools.vscode-azureappservice", | |
| "publisherDisplayName": "ms-azuretools" | |
| }, | |
| "name": "vscode-azureappservice", | |
| "publisher": "ms-azuretools", | |
| "version": "0.13.0" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "2ed5adbe-c4e1-4227-8e41-31e2095b30e3", | |
| "publisherId": "ms-azuretools.vscode-azurefunctions", | |
| "publisherDisplayName": "ms-azuretools" | |
| }, | |
| "name": "vscode-azurefunctions", | |
| "publisher": "ms-azuretools", | |
| "version": "0.16.0" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "2a1fdf76-30a9-4155-94f1-73462a7cee3f", | |
| "publisherId": "ms-azuretools.vscode-azurestorage", | |
| "publisherDisplayName": "ms-azuretools" | |
| }, | |
| "name": "vscode-azurestorage", | |
| "publisher": "ms-azuretools", | |
| "version": "0.7.0" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "957cd83d-dc33-4cd0-9550-62c93f227481", | |
| "publisherId": "jorgeserrano.vscode-csharp-snippets", | |
| "publisherDisplayName": "jorgeserrano" | |
| }, | |
| "name": "vscode-csharp-snippets", | |
| "publisher": "jorgeserrano", | |
| "version": "0.3.1" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "9ccc1dd7-7ec4-4a46-bd4f-7d7b8b9d322a", | |
| "publisherId": "vscode-icons-team.vscode-icons", | |
| "publisherDisplayName": "vscode-icons-team" | |
| }, | |
| "name": "vscode-icons", | |
| "publisher": "vscode-icons-team", | |
| "version": "8.5.0" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "daf8b44d-8aae-4da2-80c5-1f770219f643", | |
| "publisherId": "DavidAnson.vscode-markdownlint", | |
| "publisherDisplayName": "DavidAnson" | |
| }, | |
| "name": "vscode-markdownlint", | |
| "publisher": "DavidAnson", | |
| "version": "0.26.0" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "ae9e3eb0-3357-4cc0-90ee-598d2d384757", | |
| "publisherId": "eg2.vscode-npm-script", | |
| "publisherDisplayName": "eg2" | |
| }, | |
| "name": "vscode-npm-script", | |
| "publisher": "eg2", | |
| "version": "0.3.5" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "6989d633-909b-4ca5-b499-7160e45a54d6", | |
| "publisherId": "jmrog.vscode-nuget-package-manager", | |
| "publisherDisplayName": "jmrog" | |
| }, | |
| "name": "vscode-nuget-package-manager", | |
| "publisher": "jmrog", | |
| "version": "1.1.6" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "937fa76c-0fd7-4e54-a4d3-d78b07f2d725", | |
| "publisherId": "fernandoescolar.vscode-solution-explorer", | |
| "publisherDisplayName": "fernandoescolar" | |
| }, | |
| "name": "vscode-solution-explorer", | |
| "publisher": "fernandoescolar", | |
| "version": "0.3.1" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "90a37ca1-92a2-488a-b196-7a8c0b0127ea", | |
| "publisherId": "ms-vscode.vscode-typescript-tslint-plugin", | |
| "publisherDisplayName": "ms-vscode" | |
| }, | |
| "name": "vscode-typescript-tslint-plugin", | |
| "publisher": "ms-vscode", | |
| "version": "1.0.0" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "876e8f93-74d0-4f4f-91b7-34a09f19f444", | |
| "publisherId": "VisualStudioExptTeam.vscodeintellicode", | |
| "publisherDisplayName": "VisualStudioExptTeam" | |
| }, | |
| "name": "vscodeintellicode", | |
| "publisher": "VisualStudioExptTeam", | |
| "version": "1.1.5" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "5a6dc0d5-dc02-4121-8e24-cad33a2ff0af", | |
| "publisherId": "ms-vsliveshare.vsliveshare", | |
| "publisherDisplayName": "ms-vsliveshare" | |
| }, | |
| "name": "vsliveshare", | |
| "publisher": "ms-vsliveshare", | |
| "version": "1.0.18" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "6626505a-e86f-46f7-9ae1-6faa22ed9aa5", | |
| "publisherId": "jeppeandersen.vstsservicestatus", | |
| "publisherDisplayName": "jeppeandersen" | |
| }, | |
| "name": "vstsservicestatus", | |
| "publisher": "jeppeandersen", | |
| "version": "1.3.0" | |
| }, | |
| { | |
| "metadata": { | |
| "id": "f508f5d8-df4a-4826-8b84-90b9af0caa07", | |
| "publisherId": "samverschueren.yo", | |
| "publisherDisplayName": "samverschueren" | |
| }, | |
| "name": "yo", | |
| "publisher": "samverschueren", | |
| "version": "0.9.3" | |
| } | |
| ] |
This file contains hidden or 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
| // Empty |
This file contains hidden or 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
| // Empty |
This file contains hidden or 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
| { | |
| "editor.formatOnSave": true, | |
| "editor.formatOnPaste": true, | |
| "csharpfixformat.style.braces.onSameLine": false, | |
| "csharpfixformat.style.spaces.afterBracket": false, | |
| "csharpfixformat.style.spaces.afterParenthesis": false, | |
| "csharpfixformat.style.spaces.beforeParenthesis": false, | |
| "workbench.iconTheme": "vscode-icons", | |
| "git.autofetch": true, | |
| "team.showWelcomeMessage": false, | |
| "sync.gist": "", | |
| "sync.quietSync": false, | |
| "sync.removeExtensions": true, | |
| "sync.syncExtensions": true, | |
| "sync.autoDownload": false, | |
| "sync.autoUpload": false, | |
| "sync.forceDownload": false, | |
| "editor.fontLigatures": true, | |
| "editor.fontFamily": "Hasklig", | |
| "csharpfixformat.sort.usings.splitGroups": true, | |
| "csharpfixformat.style.spaces.insideEmptyBraces": false, | |
| "gitlens.mode.active": "review", | |
| "editor.minimap.enabled": false, | |
| "csharpfixformat.style.indent.preprocessorIgnored": false, | |
| "csharpfixformat.style.operators.onSameLine": false, | |
| "window.zoomLevel": -1, | |
| "vsicons.projectDetection.autoReload": true, | |
| "csharpfixformat.style.spaces.beforeIndexerBracket": false, | |
| "csharpfixformat.style.braces.allowInlines": false, | |
| "csharpfixformat.style.enabled": false, | |
| "editor.suggestSelection": "first", | |
| "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue", | |
| "terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", | |
| "files.maxMemoryForLargeFilesMB": 8192, | |
| "editor.largeFileOptimizations": false | |
| } |
This file contains hidden or 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
| { | |
| // Place your snippets for csharp here. Each snippet is defined under a snippet name and has a prefix, body and | |
| // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
| // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the | |
| // same ids are connected. | |
| // Example: | |
| "Print to console CS": { | |
| "prefix": "logcs", | |
| "body": ["Console.WriteLine('$1');", "$2"], | |
| "description": "Log output to console" | |
| }, | |
| "Print to debug CS": { | |
| "prefix": "debug", | |
| "body": ["System.Diagnostics.Debug.WriteLine($1);"], | |
| "description": "Log output to console" | |
| }, | |
| "Boolean Parameter": { | |
| "prefix": "boolParam", | |
| "body": ["[FromBody] bool $1"], | |
| "description": "Generate a boolean parameter" | |
| }, | |
| "Rest API call": { | |
| "prefix": "restApi", | |
| "body": ["${baseUrl}/${apiCall}"], | |
| "description": "Generate an api call" | |
| }, | |
| "Create Command Handler": { | |
| "prefix": "createCommand", | |
| "body": [ | |
| "private readonly $1 _repo;", | |
| "public $TM_FILENAME_BASE ($1 repo)", | |
| "{", | |
| "_repo = repo;", | |
| "}", | |
| "public async Task<$2> Handle($3 command)", | |
| "{", | |
| "if (command == null)", | |
| "{", | |
| "throw new System.ArgumentNullException(nameof(command));", | |
| "}", | |
| "try", | |
| "{", | |
| "return await _repo.Create(new $4()", | |
| "{", | |
| "$5", | |
| "});", | |
| "}", | |
| "catch (System.Exception)", | |
| "{", | |
| "return null;", | |
| "}", | |
| "}" | |
| ], | |
| "description": "Generates the command handler" | |
| }, | |
| "Update Command Handler": { | |
| "prefix": "updateCommand", | |
| "body": [ | |
| "private readonly $1 _repo;", | |
| "public $TM_FILENAME_BASE($1 repo)", | |
| "{", | |
| "_repo = repo;", | |
| "}", | |
| "public async Task<$2> Handle($3 command)", | |
| "{", | |
| "if (command == null)", | |
| "{", | |
| "throw new System.ArgumentNullException(nameof(command));", | |
| "}", | |
| "try", | |
| "{", | |
| "return await _repo.Update(new $4()", | |
| "{", | |
| "$5", | |
| "});", | |
| "}", | |
| "catch (System.Exception)", | |
| "{", | |
| "return null;", | |
| "}", | |
| "}" | |
| ], | |
| "description": "Generates the command handler" | |
| }, | |
| "Delete Command Handler": { | |
| "prefix": "deleteCommand", | |
| "body": [ | |
| "private readonly $1 _repo;", | |
| "public $TM_FILENAME_BASE($1 repo)", | |
| "{", | |
| "_repo = repo;", | |
| "}", | |
| "public async Task<bool> Handle(int id)", | |
| "{", | |
| "try", | |
| "{", | |
| "await _repo.Delete(id);", | |
| "return true;", | |
| "}", | |
| "catch (System.Exception)", | |
| "{", | |
| "return false;", | |
| "}", | |
| "}" | |
| ], | |
| "description": "Generates the command handler" | |
| }, | |
| "Get Command Handler": { | |
| "prefix": "getCommand", | |
| "body": [ | |
| "private readonly $1 _repo;", | |
| "public $TM_FILENAME_BASE($1 repo)", | |
| "{", | |
| "_repo = repo;", | |
| "}", | |
| "public async Task<$2> Handle($3 $4)", | |
| "{", | |
| "try", | |
| "{", | |
| "return await _repo.$5($4);", | |
| "}", | |
| "catch (System.Exception)", | |
| "{", | |
| "throw;", | |
| "}", | |
| "}" | |
| ], | |
| "description": "Generates the command handler" | |
| }, | |
| "Command Interface": { | |
| "prefix": "interfaceCommand", | |
| "body": ["Task<$1> Handle($2 $3);"], | |
| "description": "" | |
| }, | |
| "Command Controller": { | |
| "prefix": "commandController", | |
| "body": [ | |
| "using System.Threading.Tasks;", | |
| "using Microsoft.AspNetCore.Authorization;", | |
| "using Microsoft.AspNetCore.Mvc;", | |
| "using Microsoft.Extensions.Logging;", | |
| "using Web.Api.Core.Application.$2.$1.Commands.Create;", | |
| "using Web.Api.Core.Application.$2.$1.Commands.Update;", | |
| "using Web.Api.Core.Application.$2.$1.Commands.Delete;", | |
| "using Web.Api.Core.Application.$2.$1.Interfaces.Command;", | |
| "using Web.Api.Core.Application.$2.$1.Interfaces.Queries;", | |
| "", | |
| "namespace Web.Api.Controllers.$2", | |
| "{", | |
| "[Authorize]", | |
| "[Route(\"api/[Controller]\")]", | |
| "[Produces(\"application/json\")]", | |
| "public class $1Controller : Controller", | |
| "{", | |
| "ILogger<$1Controller> _logger;", | |
| "", | |
| "public $1Controller(ILogger<$1Controller> logger,", | |
| "ICreate$1CommandHandler create$1,", | |
| "IUpdate$1CommandHandler update$1,", | |
| "IDelete$1CommandHandler delete$1,", | |
| "IGetAll$1sCommandHandler getAll$1s,", | |
| "IGetSingle$1CommandHandler getSingle$1", | |
| ")", | |
| "{", | |
| "_create$1 = create$1;", | |
| "_update$1 = update$1;", | |
| "_delete$1 = delete$1;", | |
| "_getAll$1s = getAll$1s;", | |
| "_getSingle$1 = getSingle$1;", | |
| "}", | |
| "", | |
| "#region Service Connection", | |
| "private readonly ICreate$1CommandHandler _create$1;", | |
| "private readonly IUpdate$1CommandHandler _update$1;", | |
| "private readonly IDelete$1CommandHandler _delete$1;", | |
| "private readonly IGetAll$1sCommandHandler _getAll$1s;", | |
| "private readonly IGetSingle$1CommandHandler _getSingle$1;", | |
| "", | |
| "[HttpGet]", | |
| "public async Task<IActionResult> Get$1List()", | |
| "{", | |
| "return Ok(await _getAll$1s.Handle());", | |
| "}", | |
| "", | |
| "", | |
| "[HttpGet(\"{id}\")]", | |
| "public async Task<IActionResult> Get$1Full(int id)", | |
| "{", | |
| "var a = await _getSingle$1.Handle(id);", | |
| "return Ok(a);", | |
| "}", | |
| "", | |
| "", | |
| "[HttpPost]", | |
| "public async Task<IActionResult> Post$1([FromBody] Create$1Command model)", | |
| "{", | |
| "var ser = await _create$1.Handle(model);", | |
| "if (ser > 0)", | |
| "{", | |
| "return Ok(ser);", | |
| "}", | |
| "else", | |
| "{", | |
| "return NoContent();", | |
| "}", | |
| "}", | |
| "", | |
| "[HttpDelete(\"id\")]", | |
| "public async Task<IActionResult> Delete$1(int id)", | |
| "{", | |
| "", | |
| "if (await _delete$1.Handle(id) == true)", | |
| "{", | |
| "return Ok(true);", | |
| "}", | |
| "else", | |
| "{", | |
| "return NoContent();", | |
| "}", | |
| "}", | |
| "", | |
| "[HttpPut]", | |
| "public async Task<IActionResult> PutService([FromBody] Update$1Command model)", | |
| "{", | |
| "", | |
| "var ser = await _update$1.Handle(model);", | |
| "if (ser > 0)", | |
| "{", | |
| "return Ok(ser);", | |
| "}", | |
| "else", | |
| "{", | |
| "return NoContent();", | |
| "}", | |
| "}", | |
| "", | |
| "#endregion", | |
| "}", | |
| "}", | |
| ], | |
| "description": "" | |
| }, | |
| "DB Repository": { | |
| "prefix": "dbRepo", | |
| "body": [ | |
| "using System.Collections.Generic;", | |
| "using System.Linq;", | |
| "using System.Threading.Tasks;", | |
| "using Microsoft.EntityFrameworkCore;", | |
| "using Web.Api.Core.Application.Database.$1.Queries.Get;", | |
| "using Web.Api.Core.Application.Database.$1.Queries.GetAll;", | |
| "using Web.Api.Core.Application.Interfaces.GateWays.Repositories;", | |
| "using Web.Api.Core.Domain.Entities;", | |
| "using Web.Api.Infrastructure.Persistance.Context;", | |
| "", | |
| "namespace Web.Api.Infrastructure.Persistance.Repositories", | |
| "{", | |
| "public class $1Repository : I$1Repository", | |
| "{", | |
| "private readonly ApplicationDbContext _context;", | |
| "public $1Repository(ApplicationDbContext context)", | |
| "{", | |
| "_context = context;", | |
| "}", | |
| "public async Task<int> Create($1 command)", | |
| "{", | |
| "await _context.$1.AddAsync(command);", | |
| "await _context.SaveChangesAsync();", | |
| "return command.$1Id;", | |
| "}", | |
| "", | |
| "", | |
| "public async Task<bool> Delete(int id)", | |
| "{", | |
| "try", | |
| "{", | |
| "var sp = await _context.$1.Where(s => s.$1Id == id).AsNoTracking().SingleAsync();", | |
| "sp.Deleted = true;", | |
| "_context.$1.Update(sp);", | |
| "await _context.SaveChangesAsync();", | |
| "return true;", | |
| "}", | |
| "catch (System.Exception)", | |
| "{", | |
| "return false;", | |
| "}", | |
| "}", | |
| "", | |
| "public async Task<List<GetAll$1sCommand>> GetAll()", | |
| "{", | |
| "return await _context.$1.Where(s => s.Deleted == false).Select(sp => new GetAll$1sCommand()", | |
| "{", | |
| "", | |
| "})", | |
| ".AsNoTracking().ToListAsync();", | |
| "}", | |
| "", | |
| "public async Task<GetSingle$1Command> GetSingle(int id)", | |
| "{", | |
| "return await _context.$1.Where(sp => sp.$1Id == id).Select(sp => new GetSingle$1Command()", | |
| "{", | |
| "", | |
| "})", | |
| ".AsNoTracking().SingleAsync();", | |
| "}", | |
| "", | |
| "public async Task<int> Update($1 command)", | |
| "{", | |
| "_context.$1.Update(command);", | |
| "await _context.SaveChangesAsync();", | |
| "return command.$1Id;", | |
| "}", | |
| "}", | |
| "}" | |
| ], | |
| "description": "" | |
| }, | |
| "DB Repository Interface": { | |
| "prefix": "dbRepointerface", | |
| "body": [ | |
| "Task<int> Create($1 command);", | |
| "Task<int> Update($1 command);", | |
| "Task<bool> Delete(int id);", | |
| "Task<List<GetAll$1Command>> GetAll();", | |
| "Task<GetSingle$1Command> GetSingle(int id);" | |
| ], | |
| "description": "" | |
| } | |
| } |
This file contains hidden or 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
| { | |
| // Place your snippets for cshtml here. Each snippet is defined under a snippet name and has a prefix, body and | |
| // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
| // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the | |
| // same ids are connected. | |
| // Example: | |
| // "Print to console": { | |
| // "prefix": "log", | |
| // "body": [ | |
| // "console.log('$1');", | |
| // "$2" | |
| // ], | |
| // "description": "Log output to console" | |
| // } | |
| } |
This file contains hidden or 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
Show hidden characters
| { | |
| // Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and | |
| // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope | |
| // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is | |
| // used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
| // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. | |
| // Placeholders with the same ids are connected. | |
| // Example: | |
| "Print to console JS": { | |
| "scope": "javascript,typescript", | |
| "prefix": "logjs", | |
| "body": [ | |
| "console.log('$1');", | |
| "$2" | |
| ], | |
| "description": "Log output to console" | |
| }, | |
| "HTTP Post": { | |
| "scope": "csharp", | |
| "prefix": "post", | |
| "body": [ | |
| "var $1 = await HttpRestHelper.PostSingle<$2>(\"$3\", $4);" | |
| ], | |
| "description": "Generates the post method" | |
| }, | |
| "HTTP Put": { | |
| "scope": "csharp", | |
| "prefix": "put", | |
| "body": [ | |
| "var $1 = await HttpRestHelper.PutSingle<$2>(\"$3\" + $4, $5);" | |
| ], | |
| "description": "Generates the put method" | |
| }, | |
| "HTTP Get Single": { | |
| "scope": "csharp", | |
| "prefix": "getSingle", | |
| "body": [ | |
| "var $1 = await HttpRestHelper.GetSingle<$2>(\"$3\" + $4);" | |
| ], | |
| "description": "Generates the Get for a single" | |
| }, | |
| "HTTP Get List": { | |
| "scope": "csharp", | |
| "prefix": "getList", | |
| "body": [ | |
| "var $1 = await HttpRestHelper.GetList<$2>(\"$3\");" | |
| ], | |
| "description": "Generates the Get for a list" | |
| }, | |
| "HTTP Delete": { | |
| "scope": "csharp", | |
| "prefix": "delete", | |
| "body": [ | |
| "var $1 = await HttpRestHelper.DeleteSingle<$2>(\"$3\" + $4);" | |
| ], | |
| "description": "Generates the Get for a list" | |
| }, | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment