public async Task <bool> Create(string action, EventTypes type, int?userId, int?accountId, int?gateId) { var newLog = new Log { Action = action, EventTypeId = (int)type, AccountId = accountId, UserId = userId, GateId = gateId, CreatedAt = DateTime.UtcNow, CreatedBy = "SYSTEM" }; await _context.Logs.AddAsync(newLog); _context.SaveChanges(); return(true); }