Skip to content

Instantly share code, notes, and snippets.

@OdeToCode
Created January 22, 2015 18:11
Show Gist options
  • Save OdeToCode/2e8740fc340cadb26eaf to your computer and use it in GitHub Desktop.
Save OdeToCode/2e8740fc340cadb26eaf to your computer and use it in GitHub Desktop.
protected override IEnumerable<IValueSetCode> GetEntries(bool negation)
{
// we currently are not importing allergies, but they should be here soon ...
if (DateTime.Now > new DateTime(2015, 3, 1))
{
throw new NotSupportedException("We still have no allergies imported!");
}
return Enumerable.Empty<IValueSetCode>();
}
@IDisposable
Copy link

public static partial class YourNaggingTools
{
   public static void DoItBy(this string whatNeedsDone, int year, int month, int day)
   {
      if (DateTime.Now > new DateTime(year, month, day))
         throw new NotSupportedExceptions(whatNeedsToBeDone);
   }
}

Has the advantage of making the calls easy to find... use like

   "We still have no allergies imported!".DoItBy(2015, 3, 1);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment