OrientDB-NET.binary
OrientDB-NET.binary copied to clipboard
_database.Create.Class<T>().Extends<OVertex>().CreateProperties().Run();
I am trying to implement a simple generic method to automatically generate properties of a T generic type. Currently the code throws an object reference exception.
Can you please attach a code sample of your implementation.
Thanks for your quick response. I am thinking that if i have many classes that i need to map their properties, there should a generic way to do this. See sample code below.
private void MapAllClasses(string MappingAssesmbly) { var types = Assembly.Load(MappingAssesmbly).GetTypes().Where(p => typeof(IMappable).IsAssignableFrom(p) && p.IsClass && !p.IsAbstract);
foreach (Type type in types)
{
MapClass(type);
}
}
private void MapClass<T>(T someObject)
{
_database.Create.Class<T>().Extends<OVertex>().CreateProperties().Run();
}
MapAllClasses could be called from anywhere like this MapAllClasses("OrientDBDemo");
have you been able to fix this???
No I have not. Is there a solution i can apply.
Regards, Christian Madubuko
On Sat, Feb 25, 2017 at 10:07 PM, edikep2000 [email protected] wrote:
have you been able to fix this???
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/orientechnologies/OrientDB-NET.binary/issues/118#issuecomment-282512463, or mute the thread https://github.com/notifications/unsubscribe-auth/AVJswjzX1g-oNhL4vm14xYj0iCiaYZ3Rks5rgJgDgaJpZM4J8BOJ .
please share me the code for oreintdb 2.2.33 database connection through c#.net