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
| namespace ConsoleApplication1 | |
| { | |
| public class Customer | |
| { | |
| public int Zipcode { get; set; } | |
| } | |
| } |
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
| // sending to sender-client only | |
| socket.emit('message', "this is a test"); | |
| // sending to all clients, include sender | |
| io.emit('message', "this is a test"); | |
| // sending to all clients except sender | |
| socket.broadcast.emit('message', "this is a test"); | |
| // sending to all clients in 'game' room(channel) except sender |
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
| using System; | |
| using System.Linq; | |
| using System.Net.Http; | |
| using System.Threading.Tasks; | |
| using Microsoft.AspNetCore.Builder; | |
| using Microsoft.AspNetCore.Http; | |
| using Microsoft.Extensions.Options; | |
| namespace Microsoft.AspNetCore.Proxy | |
| { |
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
| [HtmlTargetElement(Attributes = ControllersAttributeName)] | |
| [HtmlTargetElement(Attributes = ActionsAttributeName)] | |
| [HtmlTargetElement(Attributes = RouteAttributeName)] | |
| [HtmlTargetElement(Attributes = ClassAttributeName)] | |
| public class ActiveLinkTagHelper : TagHelper | |
| { | |
| private const string ActionsAttributeName = "asp-active-actions"; | |
| private const string ControllersAttributeName = "asp-active-controllers"; | |
| private const string ClassAttributeName = "asp-active-class"; | |
| private const string RouteAttributeName = "asp-active-route"; |
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
| ```css | |
| height: 100vh; | |
| display: flex; | |
| justify-content: center; | |
| align-items: center; | |
| background-color: white; | |
| overflow: hidden; | |
| ``` |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Threading.Tasks; | |
| using Microsoft.Owin; | |
| using AppFunc = System.Func<System.Collections.Generic.IDictionary<string, object>, System.Threading.Tasks.Task>; | |
| using MidFunc = System.Func< | |
| System.Func<System.Collections.Generic.IDictionary<string, object>, System.Threading.Tasks.Task>, | |
| System.Func<System.Collections.Generic.IDictionary<string, object>, System.Threading.Tasks.Task>>; | |
| public class OwinRouter |
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 ReliableSqlCommand : IDbCommand | |
| { | |
| private static readonly Policy RetryPolicy = Policy | |
| .Handle<SqlException>(ex => ex.Number == 11001 || ex.Number == 1205) | |
| .WaitAndRetry(new[] | |
| { | |
| TimeSpan.FromSeconds(1), | |
| TimeSpan.FromSeconds(2), | |
| TimeSpan.FromSeconds(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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Security.Cryptography; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using Microsoft.AspNetCore.Http; | |
| using Microsoft.AspNetCore.Mvc.Internal; | |
| using Microsoft.AspNetCore.Routing; | |
| using Microsoft.Extensions.Caching.Memory; |
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
| <Project Sdk="Microsoft.NET.Sdk.Web"> | |
| <PropertyGroup> | |
| <TargetFramework>netcoreapp1.1</TargetFramework> | |
| <DebugType>portable</DebugType> | |
| <PreserveCompilationContext>true</PreserveCompilationContext> | |
| <AssemblyName>myweb</AssemblyName> | |
| <OutputType>Exe</OutputType> | |
| <PackageId>myweb</PackageId> | |
| <RuntimeFrameworkVersion>1.1.1</RuntimeFrameworkVersion> |
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
| void Main() | |
| { | |
| var fooInstance = new FooImpl(); | |
| var proxy = DispatchProxy.Create<IFoo, FooProxy>(); | |
| dynamic p = proxy; | |
| p.SetTarget(fooInstance); | |
| var s = proxy.Bar(123); | |
| Console.WriteLine(s); |