Platform: Windows Vista
Language: ASPX / C#
I am trying to make a business library for where I work, and I have everything figured out and done except for the ObjectDataSource portion.
If any of you have used the ObjectDataSource, it binds to a static (you could bind it to a class that isnt static, but then the values and items within that class are lost after a different page load) class that has a select, update, delete, and insert method. Now thats all fine and good, but I would like to not have to copy/paste the same code for every project (hence the library... we were reusing a lot of code).
My issue is that I have a good template for the a class to be inherited and used in a project, thus that it has a select, update, insert, and delete functions, in addition to other functions needed, but .NET does not allow static classes to inherit from other static, or non static, classes.
The only viable way I see to make this possible is to do something like this (and mind you, psuedo code):
namespace Library
{
public class DataSetObjectBase
{
private list<object> objects;
public DataReader Select() {}
public void Update(object obj){}
public void Delete(object obj){}
public void Insert(object obj){}
}
}
namespace Project
{
public static class DataSetObject
{
private static Library.DataSetObjectBase base;
public static DataReader Selet() {return base.Select(); }
etc...
}
}
But with the above method it would amost be better to just include a code snippet... I would rather have a solution similiar to:
public static class DataSetObject : DataSetObjectBase
{
private static new list<otherObjects> objects;
}
for instance.. any ideas?
EDIT: Sorry, accidently pressed enter and had it submit before I was done typing