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 keys = new[] {1, 2, 3}; | |
var map1 = new Dictionary<int, string>(); | |
var map2 = new Dictionary<int, string>(); | |
var items = | |
from key in keys | |
let value1 = map1.GetValueOrDefault(key) | |
where value1 != null | |
let value2 = map2.GetValueOrDefault(key) | |
let whatever = 123 | |
select new |
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.Collections.Generic; | |
using System.Threading.Tasks; | |
namespace MyNamespace | |
{ | |
using MyType = Task<IDictionary<string, IList<(long, int)>>>; | |
public class MyClass | |
{ | |
public MyType DoStuff() |
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
httpDelete = httpReq "DELETE" | |
httpPut = httpReq "PUT" | |
httpReq : String -> String -> Http.Body -> Decode.Decoder a -> Http.Request a | |
httpReq method url body decoder = | |
Http.request | |
{ method = method | |
, headers = [] | |
, url = url | |
, body = body |
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 static class UrlSlugGenerator | |
{ | |
private static readonly IDictionary<string, string> UrlReplacementMap = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) | |
{ | |
{"&", "-"}, | |
{" ", "-"}, | |
{"/", "-"}, | |
{"+", "-"}, | |
}; |
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 existingCustomer = session.Query<Customer>() | |
.Where(c => c.CustomerId == imported.CustomerId) | |
.FetchMany(c => c.DeliveryAddresses) | |
.ToArray() | |
.SingleOrDefault(); |
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.Collections.Specialized; | |
using System.Threading; | |
namespace ConsoleApplication1 | |
{ | |
internal class Program | |
{ | |
private static void Main() | |
{ |