Contents tagged with C#
-
AnonymousComparer - lambda compare selector for Linq
One guy from Japan created a very cool linq extension. It is called AnonymousComparer, which allows to use Func instead of annoying IEqualityComparer.
-
Silverlight DataForm Auto Generation Horror!
Today I was trying to use automatic generation of DataForm from my ViewModels.
-
Silverlight Tips & Tricks: Make Silverlight DataGrid be more MVVM friendly =)
Today one guy from our dev team met some problems with binding of datagrid selected items. Because of SelectedItems is readonly property, we cannot create two way binding for it. After a short discussion we decided to create DataGridSelectedChanged command behavior which will inform our model about selected rows. (We are using microsoft p&p prism commands api).
-
ADO.NET Data-Services Advanced Topics: Custom-proxy based on T4 templates
Today SilverlightShow has published first article of my series about deep dive into ADO.NET Data Services. In this article I'm showing how to implement your own ADO.NET Data Services proxy with T4 templates.
-
Little trick with partial classes.
If you have ever look at silverlight control toolkit source you may be found that all visual states and visual state groups are stored as constants in one internal static class called visualstates.
-
Enum in ADO.NET Entity Framework v1
There is no direct support for enum type in ado.net entity framework v1. But it is rather easy to solve this problem.
All u need to do is to create int property with private getter and setter and then add public property to your partial class, which type is enum:
-
Simple database fixture.
Very often we need to write tests which interact with the database. I found that many people are still doing complex clean up manipulation in tear down method. But in most cases it is useless work. All you need to perform clean up of database after each test is to use TransactionScope. This process is so simple that it is hard to believe that it works. The main idea is to create TransactionScope object in SetUp mehod (Constructor in xUnit) and dispose it in TearDown method (Dispose in xUnit).