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 Microsoft.Azure.Documents; | |
using System.Collections.Generic; | |
using System; | |
public static async Task Run(IReadOnlyList<Document> input, TraceWriter log) | |
{ | |
foreach(var changeInput in input) | |
{ | |
if(changeInput.GetPropertyValue<string>("city") == "colombo") | |
{ |
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 Microsoft.Azure.Documents; | |
using Microsoft.Azure.Documents.Client; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace SQLSDK | |
{ |
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 ChangeFeedProcessorSDK | |
{ | |
private readonly DocumentCollectionInfo _monitoredCollection; | |
private readonly DocumentCollectionInfo _leaseCollection; | |
public ChangeFeedProcessorSDK(DocumentCollectionInfo monitorCollection, DocumentCollectionInfo leaseCollection) | |
{ | |
_monitoredCollection = monitorCollection; | |
_leaseCollection = leaseCollection; | |
} |
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
<Project Sdk="Microsoft.NET.Sdk.Web"> | |
<PropertyGroup> | |
<TargetFramework>net471</TargetFramework> | |
</PropertyGroup> | |
<ItemGroup> | |
<Folder Include="wwwroot\" /> | |
</ItemGroup> |
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 void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); | |
// This is right | |
services.AddSingleton<IProductService, ProductService>(); | |
// this is wrong and DV should fail | |
services.AddSingleton<IMyDbContext, MyDbContext>(); | |
} |
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
protected override IEnumerable<ServiceInstanceListener> CreateServiceInstanceListeners() | |
{ | |
return new ServiceInstanceListener[] | |
{ | |
new ServiceInstanceListener(serviceContext => | |
new HttpSysCommunicationListener(serviceContext, "GatewayHttpSysServiceEnpoint", (url, listener) => | |
{ | |
ServiceEventSource.Current.ServiceMessage(serviceContext, $"Starting HttpSys on {url}"); | |
return new WebHostBuilder() |
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 ReverseProxyServiceResponseFilter : IResultFilter | |
{ | |
public void OnResultExecuted(ResultExecutedContext context) | |
{ | |
if(context.HttpContext.Response.StatusCode == 404) | |
{ | |
context.HttpContext.Response.Headers.Add("X-ServiceFabric", "ResourceNotFound"); | |
} | |
} |
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
string reverseProxyUrl = "http://localhost:19801/ApplicationName/InternalServiceName/RestOfTheUri"; | |
var httpClient = new HttpClient(); | |
var response = await httpClient.GetAsync(reverseProxyUrl); |
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
string reverseProxyUrl = "http://localhost:19801/ApplicationName/InternalServiceName/RestOfTheUri"; | |
var httpClient = new HttpClient(); | |
var response = await httpClient.GetAsync(reverseProxyUrl); |
OlderNewer