Initial Commit ...

This commit is contained in:
2024-01-25 04:39:39 +03:30
commit c743026b3c
42 changed files with 3954 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
using System.IO;
using Microsoft.AspNetCore.Http;
namespace xCommons.Extensions {
public static partial class XHttpContextExtensions {
/// <summary>
/// Convert IFormFile to Bytes Array
/// </summary>
/// <param name="source"></param>
/// <returns></returns>
public static byte[] ToByteArray (this IFormFile source) {
//
byte[] data;
using (var br = new BinaryReader (source.OpenReadStream ())) {
data = br.ReadBytes ((int) source.OpenReadStream ().Length);
}
//
return data;
}
}
}