We have a few samples but they're getting started demos, meant to be easy to understand. Let's consider user authentication. Suppose you have a 'Users' table, you could put a method on your Users "Custom Class" called Login, which might look something like this:
Code:
public partial class Users : esUsers
{
bool Login(string userName, string password)
{
return (bool)this.ExecuteScalar(esQueryType.StoredProcedure,
"proc_UserLogin", userName, password);
}
}
Notice how easy it was to call a stored procedure above (technically, you could even try to load a user based on the username/password match using our DynamicQuery API as well). Then you could call the above custom Login() method like this:
Code:
Users user = new Users();
if(user.Login("sa", "wow"))
{
// he's good to go
}
Again, you could do the same with our DynamicQuery API too in this case. Of course, there is the esUtility class to that will let you hit the database without putting code in a specific custom class, this is good when things don't seem to fit the domain model, ie, exporting data and such, but it can be used for anything. Remember, you can also override most everything in your custom classes, including property accessors.
I hope this helps, feel free to follow up with a question.
EntitySpaces |
Twitter |
BLOG