32 lines
922 B
C#
32 lines
922 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace BeWo.Service.ServiceUtils
|
|
{
|
|
public static class ServiceConfigReader
|
|
{
|
|
/// <summary>
|
|
/// https://stackoverflow.com/a/3314213
|
|
/// </summary>
|
|
/// <param name="name"></param>
|
|
/// <returns></returns>
|
|
public static string GetInvoiceTestJsonString()
|
|
{
|
|
var assembly = Assembly.GetExecutingAssembly();
|
|
var resourceName = assembly.GetManifestResourceNames()
|
|
.Single(str => str.EndsWith("invoicetest.json"));
|
|
|
|
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
|
|
using (StreamReader reader = new StreamReader(stream))
|
|
{
|
|
return reader.ReadToEnd();
|
|
}
|
|
}
|
|
}
|
|
}
|