WIP Osai write file
This commit is contained in:
@@ -139,10 +139,8 @@ namespace CMS_CORE.Utils
|
||||
public static void WriteLocalFile(string fileContent, ref FileStream fileReference)
|
||||
{
|
||||
// Write Part Program
|
||||
StreamWriter writer = new StreamWriter(fileReference);
|
||||
writer.Write(fileContent);
|
||||
// Close file Writer
|
||||
writer.Close();
|
||||
using (StreamWriter writer = new StreamWriter(fileReference))
|
||||
writer.Write(fileContent);
|
||||
}
|
||||
|
||||
public static string ReadLocalFile(FileStream fileReference)
|
||||
@@ -152,8 +150,6 @@ namespace CMS_CORE.Utils
|
||||
|
||||
string fileContent = reader.ReadToEnd();
|
||||
|
||||
reader.Close();
|
||||
|
||||
return fileContent;
|
||||
}
|
||||
|
||||
@@ -173,8 +169,7 @@ namespace CMS_CORE.Utils
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
public static IEnumerable<TSource> DistinctBy<TSource, TKey>
|
||||
(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
|
||||
public static IEnumerable<TSource> DistinctBy<TSource, TKey> (this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
|
||||
{
|
||||
HashSet<TKey> seenKeys = new HashSet<TKey>();
|
||||
foreach (TSource element in source)
|
||||
|
||||
Reference in New Issue
Block a user