This is the common structure of all of my classes:
public class User
{
public int ID { get;set; }
public string User_name { get; set; }
public string Pass_word { get; set; }
public string UserTypeCode { get; set; }
public int SaveOrUpdate()
{
int id = -1;
if (this._ID <=0)
{
id = this.Save();
}
else
{
bool success = this.Update();
if(success)
{
id = this._ID;
}
else
{
throw new Exception("Update failed!");
}
}
return id;
}
private int Save() { }
private bool Update() { }
public static User Get(int id) { }
public static List<User> Get() { }
public bool Delete() { }
}
I was using these classes smoothly with winforms.
But while working with ASP.NET, when I try to configure the object data source for a GridView, I don't find the method-names in the Data Source Configuration Wizard
. I.e. they are not showing up. So my methods became useless.
I can't change this general structure of all of my classes. I have also a code generator written for them. And I must use ObjectDataSources
.
My first question is, why don't they show up?
And, what should I do to make them show up?