add all change in now.

This commit is contained in:
2025-08-29 23:17:58 +10:00
parent be2756d85f
commit 6cea606cc2
22 changed files with 259 additions and 63 deletions
@@ -7,8 +7,9 @@ using FamilyTreeAPI.Interface;
using FamilyTreeAPI.Models;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
//using System.Drawing;
using System.Linq;
using System.Threading.Tasks;
@@ -460,20 +461,28 @@ public partial class PersonRepository : IPerson
extention = System.IO.Path.GetExtension(fileName);
filename = familyId + "_" + sdate + extention;
string fullpath = System.IO.Path.Combine(path, filename);
/*
using (var fileStream = new FileStream(fullpath, FileMode.Create))
/*
using (var fileStream = new FileStream(fullpath, FileMode.Create))
{
StreamWriter writer = new StreamWriter(fileStream);
writer.Write(newBytes);
//writer.BaseStream.Write(bytes, 0, bytes.Length);
}
*/
/*
using (MemoryStream ms = new MemoryStream(newBytes))
{
StreamWriter writer = new StreamWriter(fileStream);
writer.Write(newBytes);
//writer.BaseStream.Write(bytes, 0, bytes.Length);
}
*/
using (MemoryStream ms = new MemoryStream(newBytes))
{
Image image = Image.FromStream(ms);
image.Save(fullpath);
}
}
*/
using (FileStream fileStream = new FileStream(fullpath, FileMode.Create, FileAccess.Write, FileShare.None))
{
fileStream.Write(newBytes, 0, newBytes.Length);
}
return filename;
}
public async Task<ResultModel<int>> SaveAsync(PersonForSave container)