Compare Page Revisions
« Older Revision - Back to Page History - Newer Revision »
var i = new Invoice(); i.Created(user);
i.Modified(user);
public partial class Invoice : IAuditable { }
public interface IAuditable { DateTime ModifyDate { get; set; } string ModifyUser { get; set; } DateTime CreateDate { get; set; } string CreateUser { get; set; } } public static class IAuditableExtension { public static void Created(this IAuditable e, string user) { e.CreateDate = e.ModifyDate = DateTime.Now; e.CreateUser = e.ModifyUser = user; } public static void Modified(this IAuditable e, string user) { e.ModifyDate = DateTime.Now; e.ModifyUser = user; } }
ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.