public async Task AddActivity(ActivityType ActvType, string UserID, string UserName, string Origin, string Description) { ActivitylogBM entity = new ActivitylogBM { Id = 0, ActivityType = (sbyte)ActvType, ActivityTime = DateTime.UtcNow, Description = Description, UserId = UserID, UserName = UserName, Origin = Origin, IsRead = false }; await _AppActivityLogRepository.InsertActivity(entity); }
public async Task InsertActivity(ActivitylogBM entity) { if (entity == null) { throw new ArgumentNullException("entity"); } Activitylog DBEntity = new Activitylog { Id = entity.Id, ActivityType = entity.ActivityType, ActivityTime = entity.ActivityTime, Description = entity.Description, UserId = entity.UserId, UserName = entity.UserName, Origin = entity.Origin, IsRead = entity.IsRead }; entities.Add(DBEntity); await _DBContext.SaveChangesAsync(); }