Files
Umbraco-CMS/src/Umbraco.Core/Auditing/DataAuditWriteProvider.cs
Shannon Deminick a9cb337a96 Changes ApplicationContext to expect arguments of DatabaseContext and ServiceContext for it to be
constructed. Changes DatabaseContext to not be a singleton. Changes ServiceContext not to be a singleton.
Removed ServicesFactory. Updated unit tests to support new changes.
2012-12-14 08:06:32 +05:00

29 lines
1.3 KiB
C#

using System;
using Umbraco.Core.Models.Rdbms;
using Umbraco.Core.Persistence;
namespace Umbraco.Core.Auditing
{
internal class DataAuditWriteProvider : IAuditWriteProvider
{
/// <summary>
/// Writes an audit entry to the underlaying datastore.
/// </summary>
/// <param name="objectId">Id of the object (Content, ContentType, Media, etc.)</param>
/// <param name="userId">Id of the user</param>
/// <param name="date">Datestamp</param>
/// <param name="header">Audit header</param>
/// <param name="comment">Audit comment</param>
public void WriteEntry(int objectId, int userId, DateTime date, string header, string comment)
{
ApplicationContext.Current.DatabaseContext.Database.Insert(new LogDto
{
Comment = comment,
Datestamp = date,
Header = header,
NodeId = objectId,
UserId = userId
});
}
}
}