Skip to content

Instantly share code, notes, and snippets.

@profesor79
Created February 21, 2023 07:58
Show Gist options
  • Save profesor79/425468b1d6a727ee2afd0e5cd2577ba8 to your computer and use it in GitHub Desktop.
Save profesor79/425468b1d6a727ee2afd0e5cd2577ba8 to your computer and use it in GitHub Desktop.
Separate logic from implementation variant 1
public string ProcessItFor(int id) {
var a = GetFromDatabase(id)
var johnBlogEntryCode = a.Length>15 && a.Contains("11")
var maryBlogEntryCode = a.Length<20 && a.Contains("2")
var doWeHaveOurBlogEntries = johnBlogEntryCode | maryBlogEntryCode
if(doWeHaveOurBlogEntries)
{
// some code here
}
return string.Empty;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment