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
let inline websocket<'Data> = | |
FunctionComponent.Of(fun (props: {| url : string; retryTimeSpan : TimeSpan; onConnected: bool -> unit; onMessage: 'Data -> unit |}) -> | |
let mutable currentlyConnected = false | |
let mutable wasAlreadyConnected = false | |
let connected = Hooks.useState false | |
let mutable webservice = null | |
let connect() = | |
if currentlyConnected then () else | |
let ws = WebSocket.Create(props.url) |
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
using System; | |
using System.Data; | |
using System.Data.SqlClient; | |
namespace ddd_patterns | |
{ | |
public class OnlineTickets | |
{ | |
private readonly 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
using System; | |
using System.Data.SqlClient; | |
namespace ddd_patterns | |
{ | |
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 | |
{ | |
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
namespace ddd_patterns | |
{ | |
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.Step7 | |
{ | |
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.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
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) |
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; |
NewerOlder