It may be a little fancy but is there any pattern or something to store any kind of Object in Relational database (not nosql) in optimal way?
for example in none optimal way:
class Person{
string FirstName {get;set;}
string LastName {get;set;}
}
class Product{
string Name {get;set;}
decimal Price {get;set;}
}
and in database:
CREATE TABLE Data
(Id int PRIMARY KEY,
TypeName nvarchar(50),
PropertyName nvarchar(50),
PropertyValue binary)
then records gets stored in database like this:
1 Person FirstName Jalal
2 Person LastName A.R
3 Product Name Apple
4 Product Price 2