开发者

Fluent Nhibernate - Saving object to database

开发者 https://www.devze.com 2023-02-17 12:20 出处:网络
My WCF service开发者_高级运维 is a reporting service - create reports and send them as email. Reports in the email can be an attachment/email body depending on the requirement.

My WCF service开发者_高级运维 is a reporting service - create reports and send them as email. Reports in the email can be an attachment/email body depending on the requirement.

Now, client wants to preview emails before they are being sent out, so my WCF service needs to return whole email object to calling web app. If client is happy with emails object, they can simply click 'Send out' which will then again call WCF service to send the emails.

I was thinking to save Email objects in database before they are sent to client for review. What would be the best approach to save email object in my scenerio considering:

  • I am using Fluent NHibernate
  • Each Email object can have multiple attachment
  • When instead of attachment, reports are being embedded as email body, Email message body can be heavy.

Thank you!


It all depends on how long it takes the reports to generate. If it's a matter of seconds then just recreate the report using the same parameters as the original request. If your app is anything like mine then the majority of the reporting time is spent in the database, in which case it might be satisfactory to store the formatted data returned from the query/stored procedure somewhere accessible, for example in the temp directory of the server.

I wouldn't recommend storing the binary email objects or anything of that nature in a database.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号