The EntitySpaces Community

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

Help with EntitySpaces DAL related methods

Last post 09-16-2008, 10:07 AM by martinmizzell. 29 replies.
Page 2 of 2 (30 items)   < Previous 1 2
Sort Posts: Previous Next
  •  08-18-2008, 7:00 AM 10792 in reply to 10787

    Re: Help with EntitySpaces DAL related methods

    This is great. I'm looking forward to it! Party!!!
  •  08-18-2008, 12:55 PM 10806 in reply to 10792

    Re: Help with EntitySpaces DAL related methods

    Cool, I just added the logic and ran this query. Notice how I call query.ExecuteReader()

     

    Code:
    EmployeesQuery query = new EmployeesQuery();
    query.Select(query.FirstName, query.LastName);
    query.Where(query.LastName.Like("Gri%"));

    using (IDataReader reader = query.ExecuteReader())
    {
    while (reader.Read())
    {
    string s;

    s = reader.GetString(0);
    s = reader.GetString(1);
    }
    }
     

    I'll ping you when a test build is up for you in a day or so ...


    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  08-20-2008, 1:55 PM 10845 in reply to 10806

    Re: Help with EntitySpaces DAL related methods

    There is a special build in the download area for the Developer version, it's 0820 and labeled experimental, give it a try it should work fine for you. This will all be included in our next official maintenance release.

    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  08-22-2008, 10:06 AM 10876 in reply to 10845

    Re: Help with EntitySpaces DAL related methods

    I have it and am in the process of writing some unit tests. I will let you know asap. Thanks!
  •  08-22-2008, 12:50 PM 10878 in reply to 10845

    Re: Help with EntitySpaces DAL related methods

    Ok, the unit tests are passing! Here are a couple of questions/ suggestions:

    -overload the ExecuteQuery() method to allow for CommandBahavior as a param

    -IDataReaders can have multiple steps. Take this example:

    http://www.developerfusion.co.uk/show/4638/

    How can we accomplish this using EntitySpaces? A common usage of a multi-step datareader i have seen is when you want to get a certain page of a result set but also need know how many results there are in total. "Results 10-50 of 50,000"

    Comments?

  •  08-22-2008, 5:27 PM 10879 in reply to 10878

    Re: Help with EntitySpaces DAL related methods

    I haven't been playing with the IDataReader interface at all, but I like what you are proposing it can do.

    NOTE: I also want to be cautious or careful to avoid database dependent solutions. (I.e. I want the same code to work for every db). I don't know if this ventures into that territory or not; albeit, the occassional override to gain some needed feature is generally worth it.

  •  08-22-2008, 5:52 PM 10880 in reply to 10879

    Re: Help with EntitySpaces DAL related methods

    Ya, I will add look at the other options, this should all be Database independent as well. One note however, I'm thinking of changing the API from this:

    query.ExecuteReader()

    to

    query.es.ExecuteReader()

    so this doesn't clutter up the API, still not sure on that though? What do you guy think.


    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  08-23-2008, 7:16 AM 10883 in reply to 10880

    Re: Help with EntitySpaces DAL related methods

    I prefer query.es.ExecuteReader() for the reason you mentioned.

    ES 2008.1.1110.0
    VS 2008 Pro SP1 on Vista Ultimate x64
    SQL Server 2000
  •  08-28-2008, 7:51 AM 11012 in reply to 10883

    Re: Help with EntitySpaces DAL related methods

    Agreed. Moving it to the "es" property would probably be better.
  •  09-10-2008, 8:00 AM 11277 in reply to 10878

    Re: Help with EntitySpaces DAL related methods

    martinmizzell:

    Ok, the unit tests are passing! Here are a couple of questions/ suggestions:

    -overload the ExecuteQuery() method to allow for CommandBahavior as a param

    -IDataReaders can have multiple steps. Take this example:

    http://www.developerfusion.co.uk/show/4638/

    How can we accomplish this using EntitySpaces? A common usage of a multi-step datareader i have seen is when you want to get a certain page of a result set but also need know how many results there are in total. "Results 10-50 of 50,000"

    Comments?

     Has anyone had a chance to look at multi-step datareaders?

     

  •  09-15-2008, 11:20 AM 11335 in reply to 10878

    Re: Help with EntitySpaces DAL related methods

    Hi Mike,

     It has been a few days and i havent heard anything back. I know y'all are likely busy with the 2009 version. If you don't think it fits into the vision of the product or it would be a long time to add it, please let me know and i will buy the source and personally code it.

     Thanks!

     Martin

  •  09-15-2008, 11:34 AM 11336 in reply to 11335

    Re: Help with EntitySpaces DAL related methods

    To be honest, there is no way for our Query API to return multiple result sets so I'm confused on what it is actually that you want us to add? We are pretty good about adding user requested features when they make ES better but I'm kind of lost on this one? 
    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  09-15-2008, 7:38 PM 11346 in reply to 11336

    Re: Help with EntitySpaces DAL related methods

    I have been pondering the concept this afternoon and thinking about how it could be done. Without looking at your source code, I would assume that you do something like this:

    IDataReader ExecuteReader()

    {

    IDbCommand command = DbConnection.CreateCommand();

    command.CommandText = esQuery.RenderTheCurrentQueryToText(); <-- something like that, right?

    return command.ExecuteReader();

    }

    what if the ExecuteReader method was static and took a (param esQuery[] )?

    or what about using a decorator on the class itself?

     

  •  09-16-2008, 4:55 AM 11358 in reply to 11346

    Re: Help with EntitySpaces DAL related methods

    That is exactly what Query.ExecuteReader() does, turn the query into text and then call ExecuteReader.  Are you saying you want to pass "n" number of queries and get multiple result sets back? We will probably add something like this in ES2009 when we add the ability to do "eager" fetching in the hierarchical model so I think this is something we can do.

    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  09-16-2008, 10:07 AM 11366 in reply to 11358

    Re: Help with EntitySpaces DAL related methods

    We are definitely on the same page. I think this will be a great addition to the product and I will use it extensively. I don't know if you have an early experience program but I would like to be a part of any betas if you would allow it.

Page 2 of 2 (30 items)   < Previous 1 2
View as RSS news feed in XML