-
Find the Discord channel in which you would like to send commits and other updates
-
In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe!
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
// ... | |
// #1 Indien het aantal validatiefouten groter is dan 0 dan retourneert de ValidationBehavior zelf een Response | |
// en worden latere Behaviors en de Handler niet bereikt | |
if (failures.Count > 0) { | |
var result = new TResponse(); | |
result.Messages = failures.Select(f => | |
new Message { | |
Body = f.ErrorMessage, |
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
// [i] Bestand terug te vinden onder project Logic.Behaviors | |
// #1 De interface IPipelineBehavior wordt geimplementeerd (de Handle functie ontwikkelen wordt verplicht) | |
public class LoggingBehavior<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse> | |
// #2 Net zoals in ValidationBehavior verduidelijken we onze generieke type parameters door middel van where | |
// Argument 1 is de IRequest zoals we vooraf gezien hebben in hoofdstuk 2.3 (CQRS) | |
// Argument 2 definieert dat we een Response object gaan retourneren, deze bevat de Content property | |
// tesamen met andere properties die betrekking houden tot de uitkomst van ons verzoek, eventuele foutmeldingen, etc | |
where TRequest : IRequest<TResponse> |
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
// #1 De Request, definieert als doel het bekomen van een Response<StageProfileResponseDTO> bij afhandeling | |
public class UpdateStageProfileCommand : IRequest<Response<StageProfileResponseDTO>> { | |
public StageProfileRequestDTO ProfileRequestDTO { get; set; } | |
public ParsedJwtToken ParsedJwtToken { get; set; } | |
} | |
// #2 De Request Handler, maakt gebruik van bovenstaande Request en definieert hetzelfde doel | |
public class UpdateStageProfileCommandHandler : IRequestHandler<UpdateStageProfileCommand, Response<StageProfileResponseDTO>> { | |
// #3 Om met de databank te interageren wordt gebruik gemaakt van generieke repositories |
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
public int VoegBestuurderToe(Bestuurder bestuurder) { | |
if(bestuurder is null) { | |
throw new BestuurderManagerException("Meegegeven bestuurder is null."); | |
} else if(bestuurder.Id is not null || bestuurder.Id > 0) { | |
throw new BestuurderManagerException("Id van bestuurder is reeds ingesteld."); | |
} else if(this.ZoekBestuurders("Rijksregisternummer", bestuurder.RijksRegisterNummer).Count > 0) { | |
throw new BestuurderManagerException("Er bestaat reeds een bestuurder met dit RRN."); | |
} | |
// Afhankelijkheid #1 |
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
using System; | |
using System.Linq; | |
using System.Reflection; | |
using Microsoft.Extensions.DependencyInjection; | |
public static class ServiceCollectionExtentions | |
{ | |
public static void AddAllTypes<T>(this IServiceCollection services | |
, Assembly[] assemblies | |
, bool additionalRegisterTypesByThemself = false |
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
USE BVRNET; | |
INSERT INTO [BVRNET].[dbo].[User] (DisplayName, LoginName, Email, Password, ClearanceLevels, Deleted, CreatedDate, UpdatedDate) | |
VALUES ('u1d', 'u1login', 'user@test.com', '04b7bcd583850fa5fe5ad6a9109e7a93db5d7a8330ba815041b1afdda8bf1ea3', 'User', 0, GETDATE(), GETDATE()), | |
('u2d', 'u2login', 'admin@test.com', '951351844714e596b29aa9c894bdb6e17f441fbcd77760c4596c59c64ac47222', 'User,Management', 0, GETDATE(), GETDATE()); |
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
let jwtFetchError = "Failed to gather JWT Token - check if your API is running, select a Postman Environment -- and make sure to have added the 2 default accounts (query can be found in prerequest script -or- in the documentation)"; | |
if(JSON.parse(pm.environment.get("LOGIN_WITHOUT_AUTH"))){ | |
console.log("No JWT Token was fetched due to the selected Postman Environment"); | |
return; | |
} | |
pm.sendRequest({ | |
rejectUnauthorized: false, | |
url: pm.environment.get("API_HTTP_PROTOCOL") + |
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
const echoPostRequest = { | |
url: 'https://<my url>.auth0.com/oauth/token', | |
method: 'POST', | |
header: 'Content-Type:application/json', | |
body: { | |
mode: 'application/json', | |
raw: JSON.stringify( | |
{ | |
client_id:'<your client ID>', | |
client_secret:'<your client secret>', |
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
pm.sendRequest({ | |
url: 'https://login.microsoftonline.com/' + pm.environment.get("tenantId") + '/oauth2/token', | |
method: 'POST', | |
header: 'Content-Type: application/x-www-form-urlencoded', | |
body: { | |
mode: 'urlencoded', | |
urlencoded: [ | |
{key: "grant_type", value: "client_credentials", disabled: false}, | |
{key: "client_id", value: pm.environment.get("clientId"), disabled: false}, | |
{key: "client_secret", value: pm.environment.get("clientSecret"), disabled: false}, |
NewerOlder