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 ActionResult Index(string[] array) | |
{ | |
int[] result = [0]; | |
using (var scope = _serviceProvider.CreateScope()) | |
{ | |
var service = scope.GetService<IArrayReversalService>(); | |
result = await service.Reverse(array); | |
} |
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
#!/bin/bash -e | |
set -e | |
location="westus2" | |
resource_group="dms-dev-10-rg" | |
ag_be_gw="dms-ag-backend-gw" | |
ag_be_pool="dms-ag-backend-pool" | |
ag_public_ip="dms-ag-public-ip" | |
ag_subnet="dms-app-gw-subnet" |
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
private async Task AddSensorData() | |
{ | |
SensorTickerFactory sensorTickerFactory = new SensorTickerFactory(); | |
for (int i = 0; i < 10; i++) | |
{ | |
var tick = sensorTickerFactory.GetSensorTick(); | |
await AddSensorTickIfNotExists(tick); | |
} | |
} |
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
private void DeleteAllDocs() | |
{ | |
List<SensorTick> ticks = _client.CreateDocumentQuery<SensorTick>(_dbcUri).ToList(); | |
foreach (var tick in ticks) | |
{ | |
Uri docUri = UriFactory.CreateDocumentUri(DbName, CollectionName, tick.Id); | |
_client.DeleteDocumentAsync(docUri); | |
Console.WriteLine(@"Deleted: {0}", tick.Id); | |
} |
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
private async Task ModifyAllDocs() | |
{ | |
List<SensorTick> docs = _client.CreateDocumentQuery<SensorTick>(_dbcUri).ToList(); | |
foreach (var doc in docs) | |
{ | |
doc.Temperature += 100; | |
Uri docUri = UriFactory.CreateDocumentUri(DbName, CollectionName, doc.Id); | |
await _client.ReplaceDocumentAsync(docUri.ToString(), doc); | |
Console.WriteLine(@"Updated: {0}", doc.Id); |
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
private async Task ProvisionDbIfNeeded() | |
{ | |
await client.CreateDatabaseIfNotExistsAsync(new Database { Id = dbName }); | |
await client.CreateDocumentCollectionIfNotExistsAsync( | |
UriFactory.CreateDatabaseUri(dbName), | |
new DocumentCollection { Id = collectionName } | |
); | |
} |
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 SensorTick | |
{ | |
[JsonProperty(PropertyName = "id")] | |
public string Id { get; set; } | |
[JsonProperty(PropertyName = "temperature")] | |
public int Temperature { get; set; } | |
[JsonProperty(PropertyName = "humidity")] | |
public int Humidity { get; set; } |
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 React from 'react'; | |
import PropTypes from 'prop-types'; | |
const ColorSwatch = (props) => { | |
let style = { | |
backgroundColor: props.color, | |
}; | |
return ( |
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
const hello = () => { return <h1>Hello</h1> } |
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 React from 'react'; | |
import PropTypes from 'prop-types'; | |
class ColorSwatchClass extends React.Component { | |
constructor(props) { | |
super(props); | |
} |
NewerOlder