We have a small application that uses ServiceStack OrmLite for database access. I am currently investigating a broken feature that worked previously.
There are two relevant entities:
[Alias("MyOrder")]
public class OrderEntity
{
[AutoIncrement]
public int Id { get; set; }
...
// Saved as JSV blob in the table
public AppEntity Processor { get; set; }
}
[Alias("MyApp")]
public class AppEntity
{
[AutoIncrement]
public int Id { get; set; }
...
[StringLength(64)]
public string UserName { get; set; }
public Guid? InternalUserId { get; set; }
}
Not sure if that matters but AppEntity is located in another DLL/assembly.
Now there is a strange behavior. Processors are correctly saved in the table. I can also retrieve them in integration tests. However, in production code, when a list of OrderEntity objects is fetched, Processor property is null in every instance.
I digged a little bit into ServiceStack code in the debugger and saw that the JSV string is fetched correctly in the first place but it seems to get lost on the way.
This is the unit test that works:
var connectionString = @"Server=...";
var connectionFactory = new OrmLiteConnectionFactory(connectionString, new SqlServerOrmLiteDialectProvider());
var orderRepository = new OrderRepository(connectionFactory);
var orders = orderRepository.FindBySomeFilter();
// entries have not-null .Processor property
This is a small application that doesn't work:
var connectionString = @"Server=...";
var connectionFactory = new OrmLiteConnectionFactory(connectionString, new SqlServerOrmLiteDialectProvider());
var orderRepository = new OrderRepository(connectionFactory);
var orders = orderRepository.FindBySomeFilter();
// .Processor is not retrieved / null for all entries
Versions:
.NET 4.5.2
ServiceStack 5.4.0
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)