コード例 #1
0
        public void Apply(Type subject, ISubclassAttributesMapper applyTo)
        {
            string className = subject.Name;

            if (Array.IndexOf(enumsNames, className) >= 0)
            {
                applyTo.DiscriminatorValue(EnumUtil.ParseGettingUnderlyingValue(typeof(TEnum), className));
            }
            else
            {
                throw new ArgumentException("Canot find the discriminator value for the class " + subject.FullName +
                                            " using the enum " + typeof(TEnum).FullName);
            }
        }
 protected override void OnBeforeMapSubclass(IModelInspector modelInspector, Type type, ISubclassAttributesMapper subclassCustomizer)
 {
     subclassCustomizer.DiscriminatorValue(GetDiscriminatorValue(modelInspector, type));
 }
コード例 #3
0
 private void ConfigureDiscriminatorValue(
     IModelInspector modelInspector, System.Type type,
     ISubclassAttributesMapper subclassCustomizer)
 {
     subclassCustomizer.DiscriminatorValue(type.Name);
 }
コード例 #4
0
ファイル: Subclass.cs プロジェクト: solyutor/enhima
 private static void DisciminatorValueAsClassName(IModelInspector modelInspector, Type type, ISubclassAttributesMapper subclassCustomizer)
 {
     subclassCustomizer.DiscriminatorValue(type.Name);
 }
 protected override void OnBeforeMapSubclass(IModelInspector modelInspector, Type type, ISubclassAttributesMapper subclassCustomizer)
 {
     subclassCustomizer.DiscriminatorValue(GetDiscriminatorValue(modelInspector, type));
 }