Пример #1
0
        /// <summary>
        /// Criar Log de um email
        /// </summary>
        /// <param name="newEntity"></param>
        /// <returns></returns>
        public EmailLogEntity Create(EmailLogEntity newEntity)
        {
            using (ModelContext context = new ModelContext())
            {
                newEntity.SendTime = DateTime.UtcNow;
                context.EmailLogs.Attach(newEntity);
                context.Entry(newEntity).State = System.Data.Entity.EntityState.Added;
                context.SaveChanges();
            }

            return(newEntity);
        }
Пример #2
0
 public Task <int> InsertAsync(EmailLogEntity entity, CancellationToken cancellationToken = default)
 {
     return(_asyncRepository.InsertAsync(data: entity, cancellationToken: cancellationToken));
 }