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 ConcurrentHashSet<T> : ICollection<T>, IEnumerable<T>, IEnumerable, IReadOnlyCollection<T> | |
| { | |
| private readonly ConcurrentDictionary<T, byte> _dictionary = new ConcurrentDictionary<T, byte>(); | |
| public int Count => _dictionary.Keys.Count; | |
| public bool IsReadOnly => false; | |
| public void Add(T item) | |
| { | |
| _dictionary.TryAdd(item, 0); | |
| } | |
| public void Clear() |
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
| app.Use(async (context, next) => | |
| { | |
| await next(); | |
| if (context.Response.StatusCode == 404 && | |
| !Path.HasExtension(context.Request.Path.Value) && | |
| !context.Request.Path.Value.StartsWith("/api/")) | |
| { | |
| context.Request.Path = "/index.html"; | |
| await next(); | |
| } |
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 void Configure(IApplicationBuilder app, IHostingEnvironment env) | |
| { | |
| app.UseDefaultFiles(); | |
| app.UseStaticFiles(); | |
| if (env.IsDevelopment()) | |
| { | |
| app.UseDeveloperExceptionPage(); | |
| } |
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 "~bootstrap/scss/bootstrap"; | |
| @each $size, $length in $spacers { | |
| .border-left-#{$size} { | |
| border-width: #{$size}px !important; | |
| } | |
| .border-top-#{$size} { | |
| border-width: #{$size}px !important; | |
| } | |
| .border-bottom-#{$size} { |
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 { HttpClient } from '@angular/common/http'; | |
| import { Observable } from 'rxjs/Observable'; | |
| @Injectible() | |
| export class MyService { | |
| public constructor(private _http: HttpClient) { | |
| } | |
| public GetValue(id: number): Observable<string> { |
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 { Component } from '@angular/core'; | |
| import { MyService } from './my.service'; | |
| @Component({ | |
| selector: 'app-my-component', | |
| template: `<div>{{myValue}}</div>` | |
| }) | |
| export class MyComponent { | |
| public myValue: string; |
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 { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |
| import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; | |
| import { MyComponent } from './my.component'; | |
| import { MyService } from './my.service'; | |
| import { Observable } from 'rxjs/Observable'; | |
| import 'rxjs/add/observable/of'; | |
| describe('MyComponent', () => { | |
| let component = MyComponent; | |
| let fixture = ComponentFixture<MyComponent>; |
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 static class MagicStrings | |
| { | |
| public const string Potato = "Potato"; | |
| public const string Tomato = "Tomato"; | |
| private static string[] _strings; | |
| public static string[] Strings | |
| { | |
| get | |
| { |
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 { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |
| import { MyComponent } from './my-component.component'; | |
| import { MyCoolClass } from '../classes/MyCoolClass.service'; | |
| describe('MyComponent', () => { | |
| let component: MyComponent; | |
| let fixture: ComponentFixture<MyComponent>; | |
| beforeEach(async(() => { | |
| TestBed.configureTestingModule({ | |
| declarations: [ MyComponent ] |
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 ConfigurationService : IConfigurationService | |
| { | |
| public ConfigurationService(IDataService dataService) | |
| { | |
| _configurationSet = dataService.GetConfigurationSet(); | |
| } | |
| public ITriangleConfiguration TriangleConfiguration => _configurationSet.TriangleConfiguration; | |
| public ISquareConfiguration SquareConfiguration => _configurationSet.SquareConfiguration; | |
| public ICircleConfiguration CircleConfiguration => _configurationSet.CircleConfiguration; |