public void ListLogEntityAsLogEntityModel()
        {
            var logEntityModel = logEntityReadRepository.Query(new QueryOptions <LogEntity>
            {
                Where = _ => true
            })
                                 .ToList()
                                 .Select(log => new LogEntityModel(log))
                                 .ToList();

            logEntityModel.ForEach(log =>
            {
                log.EntityType.FullName.Should().Be(log.EntityFullName);
                Guid.TryParse(log.TransactionId, out Guid _).Should().BeTrue();
                log.OriginalValues.GetType().Should().Be(log.EntityType);

                if (log.LogActionType == LogActionType.Insert)
                {
                    log.ChangedValuesAsString.Should().BeNullOrEmpty();
                    log.ModifiedEntityProperties.Any().Should().BeFalse();
                }
                else if (log.LogActionType == LogActionType.Update)
                {
                    log.ChangedValuesAsString.Should().NotBeNullOrEmpty();
                    log.ModifiedEntityProperties.Any().Should().BeTrue();
                }
                else if (log.LogActionType == LogActionType.Delete)
                {
                    log.ChangedValuesAsString.Should().BeNullOrEmpty();
                    log.ModifiedEntityProperties.Any().Should().BeFalse();
                }
            });
        }
예제 #2
0
 public override IEnumerable <T> Query <T>(Dictionary <string, object> queryParameters)
 {
     return(ReadRepository.Query <T>(queryParameters));
 }
예제 #3
0
 public override IEnumerable <T> Query <T>(Func <T, bool> query)
 {
     return(ReadRepository.Query <T>(query));
 }
예제 #4
0
 public override IEnumerable <T> Query <T>(dynamic query)
 {
     return(ReadRepository.Query <T>(query));
 }
예제 #5
0
 public override IEnumerable <T> Query <T>(QueryFilter query)
 {
     return(ReadRepository.Query <T>(query));
 }
예제 #6
0
 public override IEnumerable <object> Query(string propertyName, object propertyValue)
 {
     return(ReadRepository.Query(propertyName, propertyValue));
 }
예제 #7
0
 public override IEnumerable <object> Query(Type type, Func <object, bool> predicate)
 {
     return(ReadRepository.Query(type, predicate));
 }
예제 #8
0
 public override IEnumerable <object> Query(Type type, QueryFilter query)
 {
     return(ReadRepository.Query(type, query));
 }
예제 #9
0
 public override IEnumerable <object> Query(Type type, Dictionary <string, object> queryParameters)
 {
     return(ReadRepository.Query(type, queryParameters));
 }
예제 #10
0
 public override IEnumerable <object> Query(dynamic query)
 {
     return(ReadRepository.Query(query));
 }