The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

new customer to ES 2008

Last post 07-23-2008, 7:17 PM by Mike.Griffin. 3 replies.
Sort Posts: Previous Next
  •  07-22-2008, 10:33 AM 10333

    new customer to ES 2008

    Hey guys,

    Im a new customer who picked up the product lastnight and have a question about some tutorials. I see some articles and tips etc but was wondering if there was an end to end solution of a web project that shows some common scenarios and how ES was applied to them. Login, custom business objects, etc.

    I have been tinkering with MyGenration and one of the questions is how people are extending the custom classes to say for example validate a users login. Every tables is now a class so I am curious on how to handle these situations as before you would create your objects based on the domain.

     Im pretty excited about using the product and once i get my head around some of these questions i will be moving forward with applying it to an exisitng project and future ones.

     

    Todd

  •  07-22-2008, 11:51 AM 10336 in reply to 10333

    Re: new customer to ES 2008

    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
  •  07-22-2008, 2:08 PM 10338 in reply to 10336

    Re: new customer to ES 2008

    Hi Mike,

    Thanks for the reply. When you work on a project do you let my generation generate your custom code or do go in by hand and create what you need for your domain? Im trying to get a handle on the workflow to be most productive.

  •  07-23-2008, 7:17 PM 10359 in reply to 10338

    Re: new customer to ES 2008

    Everything I add to the custom classes I do by hand, if it was some repeatable pattern I might try and create a template for it. Remember, you can slice in your own classes two at a lower level and add functionality across all of your classes.

    See the description under "Use Custom Base Class" option on the Advanced Tab in the Getting Started PDF, this can be a useful way to provide more base functionality to your classes.

    EntitySpaces | Twitter | BLOG
View as RSS news feed in XML