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 System; | |
using System.IO; | |
using System.Net; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
string path = @"c:\temp\MyTest.txt"; | |
await using FileStream fileStream = File.OpenRead(path); | |
var httpClient = new HttpClient(); | |
var formData = new MultipartFormDataContent(); |
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 (var transaction = await TableStorageTransaction<IDomainEvent>.BeginTransaction(cloudBlob, command.AggregateRootId, eventsCollector)) | |
{ | |
var currentVersion = eventsQueryable.Where(e => e.PartitionKey = command.AggregateRootId).Max(e => e.Version); | |
if (expectedVersion != currentVersion) | |
{ | |
throw new ConcurrencyException("expected version is not the same as current version"); | |
} | |
var i = currentVersion; |
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
Invoke-Command -ComputerName \\remotemachine -ScriptBlock { & "PATH_TO_SCRIPT_OR_EXECUTABLE" } -credential (new-object -typename System.Management.Automation.PSCredential -argumentlist "remoteuser", (echo "remotepassword" | ConvertTo-Securestring -AsPlainText -Force)) |
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
{ | |
"vars": { | |
"@gray-base": "#000", | |
"@gray-darker": "lighten(@gray-base, 13.5%)", | |
"@gray-dark": "lighten(@gray-base, 20%)", | |
"@gray": "lighten(@gray-base, 33.5%)", | |
"@gray-light": "lighten(@gray-base, 46.7%)", | |
"@gray-lighter": "lighten(@gray-base, 93.5%)", | |
"@brand-primary": "darken(#428bca, 6.5%)", | |
"@brand-success": "#5cb85c", |
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 cat = RebaContext.CategoryLanguages | |
.SingleOrDefault(cl => cl.Slug == categoryName && cl.Language.Iso == culture); | |
var categoryAndProducts = new ShowProductsModel | |
{ | |
Category = cat.Title, | |
Products = cat.Category.Products | |
.Select(p => new ShowProductsProductModel | |
{ | |
Id = p.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
public class DefaultController: Controller{ | |
//de webpagina | |
public async Task<ActionResult> Index(){ | |
var taak1 = Taak1(); | |
var taak2 = Taak2(); | |
//Eerst afwachten, heel belangrijk!!! taak1 en taak2 worden teglijk uitgevoerd | |
await Task.WhenAll(taak1, taak2); | |
var result1 = taak1.Result; |
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
#region ICriteria async API | |
// Usage ICriteria.ListAsync<T>() | |
var customers = await session.CreateCriteria<Customer>().ListAsync<Customer>(); | |
// Usage ICriteria.UniqueResultAsync<T>() | |
var customer = await session | |
.CreateCriteria<Customer>() | |
.Add(Restrictions.Eq("Name", "Erdtsieck")) | |
.UniqueResultAsync<Customer>(); |