在 C# 中实现对象的审计跟踪? [英] Implementing Audit Trail for Objects in C#?

查看:40
本文介绍了在 C# 中实现对象的审计跟踪?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找有关如何在 C# 中为我的对象实现审计跟踪的想法,对于当前项目,基本上我需要:

I'm looking for ideas on how to implement audit trails for my objects in C#, for the current project,basically I need to:

1.存储给定对象的旧值和新值.2.记录新对象的创建.3.删除旧对象.

1.Store the old values and new values of a given object. 2.Record creation of new objects. 3.Deletion of old object.

是否有任何通用的方法可以做到这一点,比如使用 C# 泛型,这样我就不必为基础对象的事件编写代码,比如创建、删除等(ORM 对象).问题是如果有一种方法可以注入审计跟踪,如果有人正在使用.任何人都有任何经验或他们遵循的任何方法.以面向方面 (AOP) 的方式执行此操作的任何方法.

Is there any generic way of doing this,like using C# Generics,so that I don't have to write code for events of the base object like on creation,on deletion etc.(ORM objects).The thing is that if there was a way to inject audit trail if one is using a .Anybody have any experiences or any methods they follow.Any way to do this in a Aspect-oriented (AOP) mannner.

请分享您的想法等

推荐答案

问题非常类似于您如何为您的对象实施审计跟踪(编程)?

我们已经实现了一个类似的解决方案,使用 AOP(aspectJ 实现).使用这个特定的点可以被捕获并可以执行特定的操作.

We've implemented a similar solution, using AOP (aspectJ implementation). Using this particular points can be captured and specific operations can be performed.

这可以在我们喜欢时插入和关闭.

This can be plugged in and plugged off when we like.

然而,我们的实现是在 J2EE..

However, our implementation was in J2EE..

如果你真的想在应用层做,我会建议这样做.

If you really want to do it in the app layer, i would suggest this.

希望有帮助..

这篇关于在 C# 中实现对象的审计跟踪?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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