Created
August 4, 2010 15:30
-
-
Save thedersen/508310 to your computer and use it in GitHub Desktop.
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 class Prescription | |
{ | |
public DateTime? CeasedAt { get; set; } | |
} |
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 class Prescription | |
{ | |
public DateTime? CeasedAt { get; set; } | |
public string CeasedBecauseOf { get; set; } | |
} |
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 class Prescription | |
{ | |
public DateTime? CeasedAt { get; private set; } | |
public void Cease() | |
{ | |
if (CeasedAt != null) | |
throw new InvalidOperationException("Prescription is already ceased."); | |
CeasedAt = DateTime.Now; | |
} | |
} |
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 class Prescription | |
{ | |
public DateTime? CeasedAt { get; private set; } | |
public string CeasedBecauseOf { get; private set; } | |
public void Cease(string reason) | |
{ | |
if (CeasedAt != null) | |
throw new InvalidOperationException("Prescription is already ceased."); | |
if (string.IsNullOrEmpty(reason)) | |
throw new ArgumentNullException("reason"); | |
CeasedAt = DateTime.Now; | |
CeasedBecauseOf = reason; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment