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 sealed class Book | |
{ | |
private List<string> _tags; | |
private Book() | |
{ | |
_tags = new List<string>(); | |
} | |
public Book(string name) | |
{ |
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 interface IHaveTrackingDates { } | |
public class Author : ICanBeSoftDeleted , IHaveTrackingDates | |
{ | |
// omitted code | |
} |
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 interface ICanBeSoftDeleted | |
{ | |
bool IsDeleted{ get; set;} | |
} | |
public class Author : ICanBeSoftDeleted | |
{ | |
// omitted code | |
} |
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
ALTER TABLE dbo.Employee | |
DROP Constraint UQ_Employee_SSN | |
GO | |
ALTER TABLE dbo.Employee | |
ADD SSN_CMPTD AS | |
CASE | |
WHEN SSN IS NOT NULL | |
THEN SSN |
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 class SqlServerConfigurationProvider : ConfigurationProvider , IDisposable | |
{ | |
private readonly SqlServerConfigurationSource _configurationSource; | |
public SqlServerConfigurationProvider(SqlServerConfigurationSource configurationSource) | |
{ | |
_configurationSource = configurationSource; | |
} | |
public override void Load() |
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
var securityKey = new SymmetricSecurityKey( | |
Encoding.UTF8.GetBytes("7h!$S40u1d83@$7r0n9P@5$Word")); | |
var header = new JwtHeader( | |
new SigningCredentials( | |
securityKey, | |
SecurityAlgorithms.HmacSha512Signature | |
)); | |
var claims = new[] | |
{ |
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 latest version of nodejs | |
FROM node:lts-alpine | |
# install aurelia-cli to build the app & http-server to serve static contents | |
RUN npm i -g http-server | |
RUN npm i -g aurelia-cli | |
# set working directory to app, henceforth all command will run inside this folder | |
WORKDIR /app |
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
import { IState } from "./state"; | |
import { IContact } from "contacts/models/contact"; | |
const selectContactAction = (state: IState, selectedContact: IContact) => { | |
const new_State = Object.assign({}, state); | |
new_State.contacts.selected = selectedContact; | |
return new_State; |
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 static class IdentityServerConfiguration | |
{ | |
public static IEnumerable<IdentityResource> IdentityResources => | |
new List<IdentityResource> { | |
new IdentityResources.OpenId() , | |
new IdentityResources.Profile() | |
}; | |
public static IEnumerable<ApiResource> ApiResources => | |
new[] { |