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
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>netcoreapp2.0</TargetFramework> | |
<DebugType>portable</DebugType> | |
</PropertyGroup> | |
<ItemGroup> | |
<Compile Include="../Domain/Model.fs" /> | |
<Compile Include="../Domain/Commands.fs" /> | |
<Compile Include="AuthTypes.fs" /> |
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
type Event = | |
| One | |
| Two | |
| Three | |
type Command = | |
| One |
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
open System | |
open System.ComponentModel | |
open System | |
// 1. Schreibe ein Programm, dass einen Character einliest und ihn wieder ausgibt | |
// [<EntryPoint>] | |
// let main argv = | |
// Console.WriteLine "Hallo was willste?" |
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
// Syntax (keine Klammern, Funktionsaufrufe) | |
// value binding | |
let firstname : string = "Roman" | |
open System.Reflection | |
open System.Windows.Forms | |
open System.Security.Cryptography | |
let age : int = 37 | |
// type inference |
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
module TreeBuilding | |
type Record = { RecordId: int; ParentId: int } | |
type Tree = | |
| Branch of int * Tree list | |
| Leaf of int | |
let recordId t = | |
match t with | |
| Branch (id, c) -> 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
#r "netstandard" | |
#load @"..\.paket\load\netstandard2.0\main.group.fsx" | |
@"Step3\Infrastructure3.fs" | |
@"Step3\Domain3.fs" | |
@"Step3\Program3.fs" | |
@"Step3\Tests3.fs" | |
open Step3.Domain | |
open Step3.Domain.Projections | |
open Step3.Program |
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.Data.SqlClient; | |
namespace ddd_patterns.Step2 | |
{ | |
public class OnlineTickets | |
{ | |
private readonly string _connectionString; | |
public OnlineTickets(string connectionString) |
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
namespace ddd_patterns.Step6 | |
{ | |
public interface IPaymentService | |
{ | |
public bool Pay(decimal amount, decimal vat); | |
} | |
} |
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.Generic; | |
namespace ddd_patterns | |
{ | |
public class Attendee | |
{ | |
private readonly Guid _id; | |
private readonly string _firstname; | |
private readonly string _surname; |
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
namespace ddd_patterns | |
{ | |
public class AddressBook | |
{ | |
public readonly PhoneNumber HomeNumber; | |
public readonly PhoneNumber MobileNumber; | |
public readonly PhoneNumber WorkNumber; | |
public readonly ValidEmailAddress Email; | |
public AddressBook(PhoneNumber homeNumber, PhoneNumber mobileNumber, PhoneNumber workNumber, ValidEmailAddress email) |