using ApplicationLayer.GeneralNeededServices;
using Domains;
namespace Infrastructure.Database.Generic;
/// Writes data to data storage
/// should be used to save changes
public interface IGenericWriter
{
/// Add entity to data storage
/// Entity to add
/// Cancellation Token
/// Entity type
Task AddAsync(T entity, CancellationToken cancellationToken) where T : class, IEntity;
/// Update entity in data storage
/// Entity to update
/// Entity type
void Update(T entity) where T : class, IEntity;
/// Remove entity from data storage
/// Entity to remove
/// Entity type
void Remove(T entity) where T : class, IEntity;
}