Closed ilhesam closed 2 years ago
@ilhesam this is not correct model:
namespace uBeac;
public interface IHistoryEntity<TKey> : IEntity<TKey>
where TKey : IEquatable<TKey>
{
object Data { get; set; }
string ActionName { get; set; }
DateTime CreatedAt { get; set; }
}
public interface IHistoryEntity : IEntity, IHistoryEntity<Guid>
{
}
public class HistoryEntity<TKey> : Entity<TKey>, IHistoryEntity<TKey>
where TKey : IEquatable<TKey>
{
public virtual object Data { get; set; }
public virtual string ActionName { get; set; }
public virtual DateTime CreatedAt { get; set; }
}
public class HistoryEntity : HistoryEntity<Guid>, IHistoryEntity
{
}
@ilhesam it should be like this:
namespace uBeac;
public interface IHistoryEntity<TKey>
where TKey : IEquatable<TKey>
{
object Data { get; set; }
string ActionName { get; set; }
DateTime CreatedAt { get; set; }
}
@ilhesam and add Context property to History class
IApplicationContext Context { get; set; }
@ilhesam please add another method: Task AddToHistory(T data, string actionName = "None", CancellationToken cancellationToken = default);