Skip to content

Instantly share code, notes, and snippets.

@codereflection
Created October 7, 2010 20:04
Show Gist options
  • Select an option

  • Save codereflection/615790 to your computer and use it in GitHub Desktop.

Select an option

Save codereflection/615790 to your computer and use it in GitHub Desktop.
public int Import(string filePathAndName)
{
if(!fileSystem.FileExists(filePathAndName))
throw new FileNotFoundException();
var messages = fileSystem.ReadAllLines(filePathAndName)
.Select(line => parser.Parse(line));
messages.Each(message => repo.Save(message));
return messages.Count();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment