I am storing object values in strings e.g.,
string[] values = new string[] { \"213.4\", \"10\", \"hello\", \"MyValue\"};
is there any way to ge
I know this doesn't answer your question, but have you looked at Dapper micro ORM?
It's über-simple (compared to LINQ to SQL or, for that reason, Entity Framework) and does what you want.
Consider this:
public class Dog
{
public int? Age { get; set; }
public Guid Id { get; set; }
public string Name { get; set; }
public float? Weight { get; set; }
}
var guid = Guid.NewGuid();
var dog = connection.Query("select * from Dogs where Id = @Id",
new { Id = 42 }
).First();
Dapper itself is packaged in a single file and, reportedly, is used by StackOverflow team (apart from Linq to SQL).