Beispiel #1
0
        private AggregateRootDescriptor GetAggregateRootDescriptor(Type type)
        {
            if (!DomainTypeHelper.IsAggregateRoot(type))
            {
                return(null);
            }

            var result = new AggregateRootDescriptor(type);

            return(result);
        }
        private AggregateRootDescriptor GetAggregateRootDescriptor(Type type, List <Type> persistentTypes)
        {
            if (!DomainTypeHelper.IsAggregateRoot(type))
            {
                return(null);
            }

            var result = new AggregateRootDescriptor(type);

            //get persistent object.
            var currentPersistentType = persistentTypes.FirstOrDefault(s =>
                                                                       TypeHelper.GetGenericArguments(s, typeof(IPersistentObject <,>))?[1] == type);

            if (currentPersistentType != null)
            {
                result.SetPersistentObject(currentPersistentType);
            }

            return(result);
        }