public void AddMetaDataAndProcessImage(ImageModel image, string inputPath, string outputPath) { var imageList = imageMetadata.Images.ToList(); var nextId = imageList.Last().Id + 1; var newImageModel = new ImageModel { Id = nextId, Location = image.Location, Name = image.Name, Filename = $"{nextId}_{image.Name}" }; ResizeImage.Process(inputPath, $@"{outputPath}\raw\{newImageModel.Filename}", ResizeImage.ImageType.Raw); ResizeImage.Process(inputPath, $@"{outputPath}\preview\{newImageModel.Filename}", ResizeImage.ImageType.Preview); ResizeImage.Process(inputPath, $@"{outputPath}\thumbnail\{newImageModel.Filename}", ResizeImage.ImageType.Thumbnail); imageList.Add(newImageModel); imageMetadata.Images = imageList; }