Posted in August 5, 2008 ¬ 10:24 amh.admin
I’ve never really used Generics before so I’m still struggling with it.What I think I want to do, is have a method that returns List;. I can return the list ok, and I can use Activator to create new T objects. The only problem is that my test requires some boxing, which is what I [...]
Read the rest of this entry »
Posted in August 4, 2008 ¬ 3:13 pmh.Chris Richards
I ran into a problem when trying to get the object to return a list. This has given me time to kinda rethink some of the choices I’ve made.I’ve never liked the internal object, but didn’t know of a way I would like better. I’m wondering if it would be better to have Methods to [...]
Read the rest of this entry »
Posted in July 31, 2008 ¬ 8:34 amh.Chris Richards
I’ve been thinking about whether the DBObject should use generics for returning lists or use a custom list object. I think from a coding perspective generics would seem like the easier choice. The DBObject user could just return List and presto you have a list of users! The down side is that you can’t add [...]
Read the rest of this entry »
Posted in July 17, 2008 ¬ 11:10 amh.Chris Richards
What I would like to be able to do is something like: UserList = User.Select( AND( LIKE( User.Email, “%gmail.com” ), EQUALS( User.Active, true ) ) ) That way it would be easy to construct whatever select statement is necessary. (I haven’t taking multiple tables into account yet.) I’ve been thinking about how to actually program [...]
Read the rest of this entry »
Posted in July 17, 2008 ¬ 10:24 amh.Chris Richards
After writing PropertyInfo[] obj_properities = this.GetType().GetProperties();foreach (PropertyInfo prop in obj_properities){ //Is this the Properity we are looking for? if (prop.Name == properity) { //Get the Attributes on the Properity object[] prop_attributes = prop.GetCustomAttributes(true); foreach (object attribute in prop_attributes) { //Is this the Column Name? if (attribute is DBColumn) { //Do Something break; } } }} [...]
Read the rest of this entry »
Posted in July 16, 2008 ¬ 8:15 pmh.admin
I haven’t posted in a while (a year!) I’m working on a .Net project to create a set of MySql Objects. I’m basing this design off of python’s SQLObject. The idea is to create an Object that inherits from DBObject, then set attributes to denote the table and the columns. Example: [DBTable("user")]public class User : [...]
Read the rest of this entry »