Archive for the ‘DBObject’ Category

Generics Issues

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 [...]

Share
Read the rest of this entry »

Problem, Expected

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 [...]

Share
Read the rest of this entry »

Generics List or Custom List

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 [...]

Share
Read the rest of this entry »

.Select()

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 [...]

Share
Read the rest of this entry »

Internal

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; } } }} [...]

Share
Read the rest of this entry »

DBObject

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 : [...]

Share
Read the rest of this entry »