Hi @Abdul Rehman Aftab ,
Do you have an app code similar to this?
https://www.c-sharpcorner.com/article/developing-web-applications-with-asp-net-core-dotvvm-and-postgresql/
here is a thread on using that on c#:
https://stackoverflow.com/questions/23026949/how-to-backup-restore-postgresql-using-code
to get started you would need to add the nugets: