EF SQL Server数据库-时限记录 [英] EF SQL Server Database - Timebound records

查看:77
本文介绍了EF SQL Server数据库-时限记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在我的项目中,我想实现一种有时间限制的记录的机制.例如,假设客户使用以下内容创建交易:
TransactionID,发件人,发件人等,CreationDate

我想在创建日期后5天删除这些记录.

为此,有一些想法可以在生产中使用.
我正在使用实体框架,代码优先模型.我想知道如何继续处理此问题.它必须是SSMS中的预定作业吗?还是有更好的方法在代码中处理这些情况?

任何想法都表示赞赏.

谢谢.

Hi,

In my project, i want to implement a mechanism for time bound records. For example, lets say the customer creates a transactions with:
TransactionID, From, To, etc, CreationDate

And i want to delete these records, 5 days after creation date.

It would be great to get some ideas to use in production for this.
I am using Entity Framework, Code-First model. I want to know how to proceed about this issue. Does it have to be a Scheduled Job in SSMS? or is there a better way to handle these situations in code?

Any ideas are appreciated.

Thank you.

推荐答案

我会去参加安排好的工作(
I would go for a scheduled job (Create a Job[^]) for ease of use and maintainability.


这篇关于EF SQL Server数据库-时限记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆