I have a C# web app that needs a batched nightly email process generated out of it – I’m trying to figure out the best approach for this.
In an application I managed in the past we had a separate email program that did the generation and was scheduled to run with the server’s Task Scheduler. The problem with this is that a lot of the DAL is duplicated between the web app and the scheduled program.
I was wondering if anybody had a better approached to this scenario, or if anyone had any suggestions going forward. I keep thinking there has to be a better way.
Thanks!
If the only reason you don’t want to use a separate project to send your email is the common Dal code, then break your Dal code into a separate project and have both applications share the some code base.
Trying to set up your web application to do scheduled processing is going to be painful and flaky. If you really don’t want to have a shared Dal lib then setup a web service in your web application that can be called by a scheduled task that batches and send the email.
But I can say from personal experience, in the long run you are going to be much happier splitting your dal off and using a shared code base for both apps