I have been struggling with peta poco and related classes and are getting the error "Couldn't find split point between PetaPocoProofOfConcept.Resource and PetaPocoProofOfConcept.BookingType".
My two classes are:
[TableName("Resource"), PrimaryKey("Id")]
public class Resource
{
public int Id { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public long MinTimeSpan { get; set; }
public long MaxTimeSpan { get; set; }
public long FixedTimeSpan { get; set; }
public DateTime ActiveStart { get; set; }
public DateTime ActiveEnd { get; set; }
public bool Active { get; set; }
public BookingType BookingType { get; set; }
public int StatusId { get; set; }
}
[TableName("BookingType"), PrimaryKey("Id")]
public class BookingType
{
public int Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
}
I get the error when executing this line of code:
using (var connection = new SqlConnection(ConnectionString))
{
connection.Open();
var resources = new Database(connection).Query<Resource, BookingType>("SELECT * FROM [Resource]").ToList();
}
I have been reading some documentation but cant seem to find any answer of why this fails. Does anyone know?
Thanks :)