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
static void Main(String[] args) | |
{ | |
var points = new[] { 1, 2, 3, 4, 5 }; | |
var distance = points | |
.Zip(points.Skip(1), Tuple.Create) | |
.Select(x => ComputeDistance(x.Item1, x.Item2)) | |
.Sum(); | |
} |
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 query = new TableQuery<DomainEvent>().Where(TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, "Value")); | |
var events = table.ExecuteQuery(query, resolver); |
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
EntityResolver<BaseClass> resolver = (partition, row, timestamp, properties, etag) => | |
{ | |
var type = Type.GetType(properties["Type"].StringValue); | |
var entity = (BaseClass)Activator.CreateInstance(type); | |
entity.PartitionKey = partition; | |
entity.RowKey = row; | |
entity.Timestamp = timestamp; | |
entity.ETag = etag; | |
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 BaseClass : TableEntity | |
{ | |
public string PartitionKey { get; set; } | |
public string RowKey { get; set; } | |
public DateTimeOffset Timestamp { get; set; } | |
public string ETag { get; set; } | |
public BaseClass() | |
{ | |
} |
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 partial class App : Application | |
{ | |
public App() | |
{ | |
var bootstrapper = new WindsorApplicationBootstrapper<ShellView>(); | |
} | |
} |
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
<Application x:Class="Caliburn.Micro.Toolkit.App" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:local="clr-namespace:Caliburn.Micro.Toolkit"> | |
<Application.Resources> | |
<ResourceDictionary> | |
<ResourceDictionary.MergedDictionaries> | |
<ResourceDictionary> | |
<local:ApplicationBootstrapper x:Key="bootstrapper"/> | |
</ResourceDictionary> |
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 ApplicationBootstrapper : Bootstrapper<ShellViewModel> | |
{ | |
} |
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 UploadDirectoryToBlobStorage(String directory, CloudBlobDirectory virtualDirectory = null) | |
{ | |
var directoryInfo = new DirectoryInfo(directory); | |
var blobReferenceBuilder = (virtualDirectory == null) ? | |
(Func<String, CloudBlockBlob>) (n => _container.GetBlockBlobReference(n)) : | |
(Func<String, CloudBlockBlob>) (n => virtualDirectory.GetBlockBlobReference(n)); | |
var files = directoryInfo.GetFiles(); | |
Array.ForEach(files, f => |
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
GET http://codiceplastico.blob.core.windows.net/site?restype=container&comp=list&delimiter=%2F&timeout=90 | |
GET http://codiceplastico.blob.core.windows.net/site?restype=container&comp=list&prefix=folder%2F&delimiter=%2F&timeout=90 |
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
CloudBlobDirectory - http://codiceplastico.blob.core.windows.net/site/folder/ | |
CloudBlockBlob - http://codiceplastico.blob.core.windows.net/site/pippo.html |
NewerOlder