Last active
June 27, 2016 12:02
-
-
Save ukitaka/1b57957aba6c9dd3be1ac036c45ad972 to your computer and use it in GitHub Desktop.
SwiftでDDD - Entity用のprotocol
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 protocol Entity: Equatable { | |
associatedtype ID: Equatable | |
var id: ID { get } | |
} | |
public func ==<E: Entity>(lhs: E, rhs: E) -> Bool { | |
return lhs.id == rhs.id | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment