Beispiel #1
0
        public void OnProvidersExecuting(DomainObjectModelContext context)
        {
            var allTypes = context.DomainLayerAssembly.SelectMany(s => s.GetTypes().Where(type => TypeHelper.IsConcrete(type)));

            foreach (var findType in allTypes)
            {
                if (!DomainTypeHelper.IsDomainObject(findType))
                {
                    continue;
                }

                var entityDes        = GetEntityDescriptor(findType);
                var aggregateRootDes = GetAggregateRootDescriptor(findType);
                var valueObjectDes   = GetValueObjectDescriptor(findType);

                if (entityDes != null)
                {
                    context.Result.Entities.Add(entityDes);
                }
                if (aggregateRootDes != null)
                {
                    context.Result.AggregateRoots.Add(aggregateRootDes);
                }
                if (valueObjectDes != null)
                {
                    context.Result.VauleObjects.Add(valueObjectDes);
                }
            }
        }
Beispiel #2
0
        public virtual void Execute(object needAuditEntity, RepositoryEntityState entityState)
        {
            //Only deal with micake domain object.
            var entityType = needAuditEntity.GetType();

            if (!typeof(IPersistentObject).IsAssignableFrom(entityType) && !DomainTypeHelper.IsDomainObject(entityType))
            {
                return;
            }

            var model = new AuditObjectModel(needAuditEntity, entityState);

            foreach (var auditProvider in _providers)
            {
                auditProvider.ApplyAudit(model);
            }
        }
Beispiel #3
0
 private Assembly[] GetDomianLayer(IMiCakeModuleCollection miCakeModules)
 {
     return(miCakeModules.GetAssemblies(false).Where(asm =>
                                                     asm.GetTypes().AsEnumerable().Any(inModuleType =>
                                                                                       DomainTypeHelper.IsDomainObject(inModuleType))).ToArray());
 }