Пример #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);
                }
            }
        }
Пример #2
0
        public DomainObjectModel CreateDomainObjectModel(Assembly[] domainLayerAsm)
        {
            var context = new DomainObjectModelContext(domainLayerAsm);

            for (var i = 0; i < _modelProviders.Length; i++)
            {
                _modelProviders[i].OnProvidersExecuting(context);
            }

            for (var i = _modelProviders.Length - 1; i >= 0; i--)
            {
                _modelProviders[i].OnProvidersExecuted(context);
            }

            return(context.Result);
        }
Пример #3
0
 public void OnProvidersExecuted(DomainObjectModelContext context)
 {
 }