public void Apply(ISubclassInstance instance)
        {
            if (instance.Name == typeof(MasterGarment).AssemblyQualifiedName)
            {
                instance.DiscriminatorValue(1);
            }

            if (instance.Name == typeof(UserGarment).AssemblyQualifiedName)
            {
                instance.DiscriminatorValue(2);
            }
        }
Beispiel #2
0
        public void Apply(ISubclassInstance instance)
        {
            var attribute = instance.EntityType.GetCustomAttribute <DiscriminatorValueAttribute>();

            if (attribute != null)
            {
                instance.DiscriminatorValue(attribute.Value);
            }
            else
            {
                instance.DiscriminatorValue(instance.EntityType.Name);
            }
        }
Beispiel #3
0
 public void Apply(ISubclassInstance instance)
 {
     if (instance.Name == typeof(DraftEmailState).AssemblyQualifiedName)
     {
         instance.DiscriminatorValue(EmailState.Draft.Name);
     }
     if (instance.Name == typeof(ToBeSentEmailState).AssemblyQualifiedName)
     {
         instance.DiscriminatorValue(EmailState.ToBeSent.Name);
     }
     if (instance.Name == typeof(SentEmailState).AssemblyQualifiedName)
     {
         instance.DiscriminatorValue(EmailState.Sent.Name);
     }
 }
 public void Apply(ISubclassInstance instance)
 {
     var attr = instance.Type.GetCustomAttribute<DiscriminatorValueAttribute>();
     instance.DiscriminatorValue(attr != null ? attr.Name : instance.Type.FullName.ToLowerInvariant());
 }
Beispiel #5
0
 public void Apply(ISubclassInstance instance)
 {
     instance.DiscriminatorValue("xxx");
 }
 public void Apply(ISubclassInstance instance)
 {
     if (instance.Name == typeof(DraftEmailState).AssemblyQualifiedName) instance.DiscriminatorValue(EmailState.Draft.Name);
     if (instance.Name == typeof(ToBeSentEmailState).AssemblyQualifiedName) instance.DiscriminatorValue(EmailState.ToBeSent.Name);
     if (instance.Name == typeof(SentEmailState).AssemblyQualifiedName) instance.DiscriminatorValue(EmailState.Sent.Name);
 }
 public void Apply(ISubclassInstance instance)
 {
     instance.DiscriminatorValue(instance.EntityType.Name);
 }
 public void Apply(ISubclassInstance instance)
 {
     Debug.WriteLine("Subclass:" + instance.EntityType.Name);
     instance.DiscriminatorValue(instance.EntityType.Name);
 }
Beispiel #9
0
 public void Apply(ISubclassInstance instance)
 {
     instance.DiscriminatorValue(instance.EntityType.Name);
 }
 public void Apply(ISubclassInstance instance)
 {
     // Use the short name of the type, not the full name
     instance.DiscriminatorValue(instance.EntityType.Name);
 }