ปรับapi กับโครงสร้างใหม่
This commit is contained in:
parent
7e1c4cb4d9
commit
54661ffbcb
37 changed files with 1542 additions and 233 deletions
29
Extensions/StreamExtension.cs
Normal file
29
Extensions/StreamExtension.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace BMA.EHR.Recruit.Service.Extensions
|
||||
{
|
||||
public static class StreamExtension
|
||||
{
|
||||
#region " Methods "
|
||||
|
||||
#region " Public "
|
||||
|
||||
public static string ToBase64(this MemoryStream stream)
|
||||
{
|
||||
stream.Seek(0, SeekOrigin.Begin);
|
||||
byte[] bytes;
|
||||
using (var memoryStream = new MemoryStream())
|
||||
{
|
||||
stream.CopyTo(memoryStream);
|
||||
bytes = memoryStream.ToArray();
|
||||
}
|
||||
|
||||
return Convert.ToBase64String(bytes);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue