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.Data.Entity.Core.Metadata.Edm; | |
using System.Data.Entity.Infrastructure; | |
using System.Data.Entity.ModelConfiguration.Conventions; | |
namespace EFTest.Entities.Conventions | |
{ | |
public class RemoveUnderscoreForeignKeyNamingConvention : IStoreModelConvention<AssociationType> | |
{ | |
public void Apply(AssociationType item, DbModel model) |
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
<!DOCTYPE html><meta charset="utf-8"><title>a</title> |
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; | |
public struct KeyValuePair<TKey, TValue> : IEquatable<KeyValuePair<TKey, TValue>> | |
{ | |
public KeyValuePair(TKey key, TValue value) | |
{ | |
Key = key; | |
Value = value; | |
} |
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 StringEncodingUtilities | |
{ | |
public static IEnumerable<string> GetBytes(this string input, Encoding encoding) | |
{ | |
if (input == null) | |
{ | |
throw new ArgumentNullException(nameof(input)); | |
} | |
if (encoding == null) |
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
// int -> 'a -> unit | |
printfn "Current index: %i Current element: %A" |
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
// the function parameter has the signature int -> char -> unit | |
List.iteri (printfn "Current index: %i Current element: %A") ['a'..'e'] |
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
// The lambda still has the signature of int -> char -> unit | |
List.iteri (fun i -> printfn "Current index: %i Current element: %A" (i + 1)) ['a'..'e'] |
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
// int -> int -> int | |
let add x y = x + y | |
// int -> (int -> int) | |
let add x = (+) x | |
// (int -> int -> int) | |
let add = (+) |
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
// (int -> int) | |
let addOne = (+) 1 | |
// Analogous to the above | |
let addOne x = 1 + x | |
// Analogous to the above as well | |
let addOne x = (+) 1 x | |
// Eta-reduction of the above |
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
val addOne: int -> int | |
val List.iteri: (int -> 'a -> unit) -> 'a list -> unit |
OlderNewer