Created
March 8, 2011 05:33
-
-
Save codelinq/859904 to your computer and use it in GitHub Desktop.
Don't Do This
This file contains hidden or 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 SystemUser | |
| { | |
| public Guid Id { get; set; } | |
| public string Name { get; set; } | |
| public string Email { get; set; } | |
| public string IsActive { get; set; } | |
| } |
This file contains hidden or 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 SystemUser | |
| { | |
| public Guid Id { get; set; } | |
| public string Email { get; set; } | |
| public string Name { get; set; } | |
| public string IsActive { get; set; } | |
| public bool IsValid() | |
| { | |
| return !String.IsNullOrEmpty(this.Name); | |
| } | |
| public void Save() | |
| { | |
| //Persist to database | |
| } | |
| public static SystemUser GetById(Guid id) | |
| { | |
| //Retrieve from database | |
| } | |
| } |
This file contains hidden or 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 UserRepository | |
| { | |
| public void Save(SystemUser user) | |
| { | |
| //Persist to database | |
| } | |
| public static SystemUser GetById(Guid id) | |
| { | |
| //Retrieve from database | |
| } | |
| } |
This file contains hidden or 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 ValidUserSpecification | |
| { | |
| public bool IsSatisfied(SystemUser user) | |
| { | |
| return !String.IsNullOrEmpty(user.Name); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment