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
{ | |
"SessionData": [ | |
{ | |
"PutRequest": { | |
"Item": { | |
"UserID": {"N": "5346747"}, | |
"CreationTime": {"N": "1544016418"}, | |
"ExpirationTime": {"N": "1544140800"}, | |
"SessionId": {"N": "6734678235789"} | |
} |
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
USE master; | |
GO | |
ALTER DATABASE [<database_name, varchar(16), database_name>] | |
SET SINGLE_USER WITH ROLLBACK IMMEDIATE; | |
GO | |
DECLARE | |
@DatabaseName nvarchar(16) ='<database_name, varchar(16), database_name>', | |
@BackupPath nvarchar(255) = '<backup_path, varchar(255), backup_path>', |
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
import { Injectable } from '@angular/core'; | |
import { CanDeactivate } from '@angular/router'; | |
import { Observable } from 'rxjs/Observable'; | |
import 'rxjs/add/observable/from'; | |
import { EditableDataComponent } from './editable-data.component'; | |
@Injectable() | |
export class UnsavedChangesGuard implements CanDeactivate<EditableDataComponent> { |
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
#!/bin/sh | |
# Helper | |
safeRunCommand() { | |
typeset cmd="$*" | |
typeset ret_code | |
echo cmd=$cmd | |
eval $cmd | |
ret_code=$? |
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
public class ValidateModelStateAttribute : ActionFilterAttribute | |
{ | |
public override void OnActionExecuting(ActionExecutingContext context) | |
{ | |
if (!context.ModelState.IsValid) | |
{ | |
context.Result = new BadRequestObjectResult(context.ModelState); | |
} |
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
public class ApiControllerCustomization : ICustomization | |
{ | |
public void Customize(IFixture fixture) | |
{ | |
fixture.Register<ICompositeMetadataDetailsProvider>(() => new CustomCompositeMetadataDetailsProvider()); | |
fixture.Inject(new ViewDataDictionary(fixture.Create<DefaultModelMetadataProvider>(), fixture.Create<ModelStateDictionary>())); | |
} | |
private class CustomCompositeMetadataDetailsProvider : ICompositeMetadataDetailsProvider | |
{ |