chore: changed entity reference order
This commit is contained in:
parent
5fa7420c04
commit
a254bb721b
@ -12,12 +12,12 @@ public class EntityReferenceConverter : IEngineTypeYamlConverter
|
|||||||
{
|
{
|
||||||
parser.Consume<MappingStart>();
|
parser.Consume<MappingStart>();
|
||||||
|
|
||||||
TypeContainer typeContainer = (TypeContainer)rootDeserializer(typeof(TypeContainer))!;
|
|
||||||
|
|
||||||
if (parser.Consume<Scalar>().Value.CompareTo(nameof(EntityReference.Id)) != 0)
|
if (parser.Consume<Scalar>().Value.CompareTo(nameof(EntityReference.Id)) != 0)
|
||||||
throw new ArgumentException($"{nameof(EntityReference)} mapping must have an {nameof(EntityReference.Id)}");
|
throw new ArgumentException($"{nameof(EntityReference)} mapping must start with {nameof(EntityReference.Id)}");
|
||||||
string id = parser.Consume<Scalar>().Value;
|
string id = parser.Consume<Scalar>().Value;
|
||||||
|
|
||||||
|
TypeContainer typeContainer = (TypeContainer)rootDeserializer(typeof(TypeContainer))!;
|
||||||
|
|
||||||
parser.Consume<MappingEnd>();
|
parser.Consume<MappingEnd>();
|
||||||
|
|
||||||
return new EntityReference() { Id = id, TypeContainer = typeContainer };
|
return new EntityReference() { Id = id, TypeContainer = typeContainer };
|
||||||
@ -28,9 +28,9 @@ public class EntityReferenceConverter : IEngineTypeYamlConverter
|
|||||||
EntityReference? entityReference = (EntityReference)value!;
|
EntityReference? entityReference = (EntityReference)value!;
|
||||||
|
|
||||||
emitter.Emit(new MappingStart());
|
emitter.Emit(new MappingStart());
|
||||||
serializer(entityReference.TypeContainer, typeof(TypeContainer));
|
|
||||||
emitter.Emit(new Scalar(nameof(EntityReference.Id)));
|
emitter.Emit(new Scalar(nameof(EntityReference.Id)));
|
||||||
emitter.Emit(new Scalar(entityReference.Id));
|
emitter.Emit(new Scalar(entityReference.Id));
|
||||||
|
serializer(entityReference.TypeContainer, typeof(TypeContainer));
|
||||||
emitter.Emit(new MappingEnd());
|
emitter.Emit(new MappingEnd());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user