Can be found here. The code include all the dependencies that you need to build the project and start playing.
Have fun...
Can be found here. The code include all the dependencies that you need to build the project and start playing.
Have fun...
So I did 70-316 exam a few hours ago, and I am not really happy about it.
It included questions about setup/deployment, security, localization as well as many questions about using datasets and accessing data. I think there was a single question that I could say related to WinForms: how to stop resizing a form.
Two questions I really dislike:
On the other hand, it does seem more relevant to the windows world, where you don't just use System.Windows.Forms.
After talking to Howard, I decided to take the 70-528 to see what the new certification model has to offer.
Zero Friction Unit Testing has always been TestDrive.Net strongest point, but with this new release, it bring it to a whole new level.
I feel that some of the new features are made for me, take this one for instnace:
That one was a personal request of mine, and I am going to really worn this botton.
There is now integration with a host of new frameworks, from TypeMock to Zanebug. But this isn't something that make me happy. What does make me Happy is this, Reflector integration:
Do you see the value that this is going to bring? Just being able to (so very easily) setup breakpoints in any code that I want is a good idea, and being able to go from 3rd party call ot its source at the press of a key is really impressive. This is going to be a shortcut key the moment I can decide which functionality I need the least (Ctrl+X, Ctrl+C, Ctrl+V).
Orand has all the details about using this.
Great work, Jamie.
Omer had a great idea yesterday in the user group meeting, we really should resume the blogger dinners around here.
Any takers? If so, please head to Omer's post and leave a comment.
Justin was sick and couldn't make it, but Roy filled in for him with a lecture about Regexes. My lecture was the second one, and I think it went very well. I managed to show everything that I planned to (although not all that I wanted), and actually got to the last slide on time, which was a major worry for me.
Things to improve:
So, I had done a couple of fairly cool stuff recently, but it is all in seperated pieces, let us try to bring them together and see what we get, shall we?
ProjectionQuery<User> query =
new ProjectionQuery<User>(Where.User.Name.Like("Ayende", MatchMode.Start),
ProjectBy.User.Name && ProjectBy.User.Email);
foreach (object[] objects in query.Execute())
{
Console.WriteLine("Name: {0}, Email: {1}", objects[0], objects[1]);
}
That is nice, isn't it? Again, we can use the strongly typed version to be type safe and avoid the use of arrays as DTO:
ProjectionQuery<User, NameAndEmail> query2 =new ProjectionQuery<User, NameAndEmail>(
Where.User.Name.Like("Ayende", MatchMode.Start),
ProjectBy.User.Name && ProjectBy.User.Email);
foreach (NameAndEmail nameAndEmail in query2.Execute())
{
Console.WriteLine("Name: {0}, Email: {1}", nameAndEmail.Name, nameAndEmail.Email);
}
And yes, this is filed under Linq as well.
Apperantly mixing implicit operators and params array is not something that you should do. The C# Compiler refuse to understand that it can first implictly convert to the type and then satisfy the params array decleration.
Sometimes it is not worth getting up in the morning. That ruined a beautiful API.
So, I have been a busy implementing crazy generics stuff and I can show you this:
public class ProjectionQuery<ARType> : ProjectionQuery<ARType, object[]>
Neat class, isn't it?
What can you do with it? Well, things like this:
ProjectionQuery<Blog> proj = new ProjectionQuery<Blog>(
Projections.Property("Name"), Projections.Property("Author"));
IList<object[]> results = proj.Execute();
Assert.AreEqual(blog.Name, results[0][0]);
Assert.AreEqual(blog.Author, results[0][1]);
Now you have got a list or arrays, which contains just the Name and Author from the Blog entity. This used to be much harder and involved writing HQL code (which can be a bummer, since I insist on putting all the HQL code in the mapping files, and not concatenating HQL).
It still has a major issue for me, and that is the fact that I need to work with untyped arrays, not fun, and I simple hate to work with numeric indices. Therefor, let us try this version:
public class ProjectionQuery<ARType, TResultItem> : IActiveRecordQuery
What does this allows me to do? Well, you can write the above snippet of code as:
ProjectionQuery<Blog, KeyValuePair<string, string>> proj = new ProjectionQuery<Blog, KeyValuePair<string, string>>(
Projections.Property("Name"), Projections.Property("Author"));
IList<KeyValuePair<string, string>> results = proj.Execute();
Assert.AreEqual(blog.Name, results[0].Key);
Assert.AreEqual(blog.Author, results[0].Value);
Notice that we suddenly have a strongly typed (if generic) way of accessing the information. In fact, in this case, a small, dedicated, class is what I would use. So I could do this:
ProjectionQuery<Blog, NameAndAuthor> proj = new ProjectionQuery<Blog, NameAndAuthor>(
Projections.Property("Name"), Projections.Property("Author"));
IList<NameAndAuthor> results = proj.Execute();
Assert.AreEqual(blog.Name, results[0].Name);
Assert.AreEqual(blog.Author, results[0].Author);
Much, much, nicer, in my opinion. :-)
And yes, there is more suprises in the pipeline :-)
Well, it is certainly an interesting release. This release contains very little code of mine, mainly minor adaptations of two wonderful patches that were sent to me.
Me, I just fixed a stupid bug by yours truly that would refuse to recognize exe as valid assemies, and put those two patches together.
Together, they make quite an addition to NQG. Especially when combined with some thing that can really understand projections... which is soon to come.
You can get it here.
No future posts left, oh my!