Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ObjectIsSavedContrains that ensures that an object has been per…
…sisted to the database. Closes #79.
- Loading branch information
Showing
3 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// ___________________________________________________ | ||
// | ||
// © Hi-Integrity Systems 2013. All rights reserved. | ||
// www.hisystems.com.au - Toby Wicks | ||
// ___________________________________________________ | ||
// | ||
|
||
using System.Collections; | ||
using System; | ||
using System.Data; | ||
|
||
namespace DatabaseObjects.Constraints | ||
{ | ||
public class ObjectIsSavedConstraint : IConstraint<IDatabaseObject> | ||
{ | ||
public bool ValueSatisfiesConstraint(IDatabaseObject value) | ||
{ | ||
return value.IsSaved; | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return "object must be saved"; | ||
} | ||
} | ||
} |
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
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