swxben / docx-template-engine

A template engine for the .NET platform which takes a DOCX file and applies a data object to generate reports, do mail merges, etc.
35 stars 17 forks source link

Deletes Destination File and Copy again to Destination #20

Open Shyam200408 opened 7 years ago

Shyam200408 commented 7 years ago

Hi Team, I would like to say thanks, that this solution is really good and works perfectly till now. However , I found one issue in code under DocXTemplateEngine.cs > Process > Process(string source, string destination, object data):

This function checks if destination file exists, if exists then delete it and then copy source file to destination...

so my question is why do we have to do that since, we need to update same file , no one will have another copy of same file and that is not practically good approach.

I just commented lines below, and I am able to update same file which is a source file:

//if (File.Exists(destination)) File.Delete(destination); //File.Copy(source, destination);