internal DomainValuePropertyMetadata(ValuePropertyDescriptor descriptor, PropertyModelConfiguration configuration, int?keyPosition) : base(descriptor)
        {
            KeyPosition        = keyPosition;
            IsKeyMember        = keyPosition.HasValue;
            DomainValueType    = TypeHelper.GetSupportedValueType(descriptor.Property.Type, out var effectiveType).Value;
            EffectiveValueType = effectiveType;

            switch (DomainValueType)
            {
            case DomainValueType.String:
                var stringConfiguration = configuration as StringPropertyModelConfiguration;
                break;

            case DomainValueType.Boolean:
                var booleanConfiguration = configuration as BooleanPropertyModelConfiguration;
                break;

            case DomainValueType.Number:
                var numberConfiguration = configuration as NumericPropertyModelConfiguration;
                break;

            case DomainValueType.DateTime:
                var dateTimeConfiguration = configuration as DateTimePropertyModelConfiguration;
                break;

            case DomainValueType.TimeSpan:
                var timeSpanConfiguration = configuration as TimeSpanPropertyModelConfiguration;
                break;

            case DomainValueType.Enum:
                var enumConfiguration = configuration as EnumPropertyModelConfiguration;
                EnumType = Nullable.GetUnderlyingType(descriptor.Property.Type) ?? descriptor.Property.Type;
                break;

            case DomainValueType.ValueObject:
                var valueTypeConfiguration = configuration as ValueObjectPropertyModelConfiguration;
                break;
            }
        }
示例#2
0
        internal DomainValueListPropertyMetadata(ValueListPropertyDescriptor descriptor, PropertyModelConfiguration configuration) : base(descriptor)
        {
            if (descriptor.IsReadOnly)
            {
                var listConfiguration = configuration as ValueReadOnlyListPropertyModelConfiguration;
            }
            else
            {
                var listConfiguration = configuration as ValueListPropertyModelConfiguration;
            }

            ElementType              = descriptor.ElementType;
            IsImmutable              = descriptor.IsReadOnly;
            ElementDomainValueType   = TypeHelper.GetSupportedValueType(ElementType, out var effectiveType).Value;
            EffectiveListElementType = effectiveType;
        }
        internal DomainAggregateListPropertyMetadata(AggregateListPropertyDescriptor descriptor, PropertyModelConfiguration configuration) : base(descriptor)
        {
            if (descriptor.IsReadOnly)
            {
                var listConfiguration = configuration as AggregateReadOnlyListModelConfiguration;
            }
            else
            {
                var listConfiguration = configuration as AggregateListProprertyModelConfiguration;
            }

            AggregateType = descriptor.ElementType;
            IsImmutable   = descriptor.IsReadOnly;
        }
示例#4
0
 internal DomainAggregatePropertyMetadata(AggregatePropertyDescriptor descriptor, PropertyModelConfiguration configuration) : base(descriptor)
 {
     var aggregateConfiguration = configuration as AggregatePropertyModelConfiguration;
 }