/PetaPoco.Tests/Utils.cs

http://github.com/toptensoftware/PetaPoco · C# · 22 lines · 18 code · 3 blank · 1 comment · 0 complexity · dc7f77194c1bbd71dd781e9ecec7a413 MD5 · raw file

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace PetaPoco.Tests
  6. {
  7. class Utils
  8. {
  9. public static string LoadTextResource(string name)
  10. {
  11. // get a reference to the current assembly
  12. var a = System.Reflection.Assembly.GetExecutingAssembly();
  13. System.IO.StreamReader r = new System.IO.StreamReader(a.GetManifestResourceStream(name));
  14. string str = r.ReadToEnd();
  15. r.Close();
  16. return str;
  17. }
  18. }
  19. }