Hi,
A little bit of background. I have created an application which has taken the data from a SQL database and has added it into Mongo. From here I created a Realm based app using dotnet MAUI which has all worked fine until I wanted to add an array of class I called PatternImage as part of primary object called Pattern.
I added this in as can be seen below:
public class Pattern : RealmObject
{
[PrimaryKey]
[MapTo("_id")]
public ObjectId Id { get; set; }
public Guid UserId { get; set; }
public DateTimeOffset DateCreated { get; set; }
public DateTimeOffset DateUpdated { get; set; }
public string? PatternNumber { get; set; }
public string? Description { get; set; }
public int? BustInInches { get; set; }
public int? WaistInInches { get; set; }
public ObjectId? DecadeTypeId { get; set; }
public ObjectId? GarmentTypeId { get; set; }
public bool IsFavourite { get; set; }
public IList<PatternImage> PatternImages { get; }
}
This is how I see this needing to be configured according to the documentation.
I added a PatternImage and this adds fine and appears in the MongoDb without a problem but then disappears from the Realm and I’m getting the following error:
Failed to transform received changeset: Schema mismatch: Link property 'PatternImages' in class 'Pattern' points to class 'PatternImage' on one side and to 'Pattern_PatternImages' on the other. (ProtocolErrorCode=201)
Without ripping my code apart, I’m trying to understand what I need to do to fix this and am looking for suggestions.
public class PatternImage : EmbeddedObject
{
public string StoragePath { get; set; }
public string ImageFilePath { get; set; }
public bool IsMainImage { get; set; }
}