จัดระเบียบ Code ใหม่ และเพิ่ม Extension Method
implement GenericRepository Class ใหม่
This commit is contained in:
parent
e49c6a4aca
commit
89de09d213
21 changed files with 1439 additions and 63 deletions
29
BMA.EHR.Domain/Extensions/StreamExtension.cs
Normal file
29
BMA.EHR.Domain/Extensions/StreamExtension.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace BMA.EHR.Domain.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