123456789101112131415161718192021222324252627282930313233343536373839 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Reflection;
- using MTWorkHR.Application.Services.Interfaces;
- using MTWorkHR.Core.UnitOfWork;
- using MTWorkHR.Core.IRepositories.Base;
- namespace MTWorkHR.Application.Services
- {
- public class LogService<TEntity>: ILogService<TEntity> where TEntity : class
- {
- private readonly IUnitOfWorkLog unitOfWork;
-
- public LogService(IUnitOfWorkLog _unitOfWork)
- {
- unitOfWork = _unitOfWork;
-
-
- }
- public virtual async Task Create(TEntity input)
- {
- IRepositoryLog<TEntity> repository = (IRepositoryLog<TEntity>)unitOfWork.GetRepositoryByName(input.GetType().Name);
-
- await repository.AddAsync(input);
- await unitOfWork.CompleteAsync();
- }
- }
- }
|