private File GetImage(IFormFile file) { return(new File { Content = fileHandler.GetBytes(file), Extension = fileHandler.GetExtension(file) }); }
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) } }); }