my db looks like this:
public class BrContext:DbContext
{
public DbSet<Conversation> AllConversations { get; set; }
public DbSet<ChatReference> ChatReferences { get; set; }
public DbSet<Product> Products { get; set; }
}
My Conversation
Model looks like this:
public class Conversation
{
[Key]
public int ConversationId { get; set; }
public string ConverserName { get; set; }
public List<ChatReference> AllReferences { get; set; }
public ChatReference CurrentChatReference { get; set; }
public bool IsDealtWith { get; set; }
}
My ChatReference
Model looks like this:
public class ChatReference
{
public int ChatReferenceId { get; set; }
public string ChatReferenceTime { get; set; }
public string ChatReferenceContent { get; set; }
public bool IsR { get; set; }
}
as you see - I have a list {"AllReferences"} of 'CurrentChatReference' as a property in a model that is saved in the DB.
I have times in the course of debugging the project , that when i look at the values in the DB - i see that the order of the ChatReferences in the list 'AllReferences' in the latest conversation in the db has been switched around.
Does anyone have an idea of why this is happening?