예제 #1
0
 private File GetImage(IFormFile file)
 {
     return(new File
     {
         Content = fileHandler.GetBytes(file),
         Extension = fileHandler.GetExtension(file)
     });
 }
예제 #2
0
 public T Map <T>(TypeViewModel viewModel)
     where T : IType, new()
 {
     return(new T
     {
         Id = viewModel.Id == Guid.Empty
         ? Guid.NewGuid()
         : viewModel.Id,
         Name = viewModel.Name,
         Icon = new BusinessLogic.Models.File
         {
             Extension = fileHandler.GetExtension(viewModel.Icon),
             Content = fileHandler.GetBytes(viewModel.Icon)
         }
     });
 }