Mapping an Pivot Query in EntityFramework6

At work I had a challenging problem in the last days (in fact I like challenging problems and they’re not that rare which is why I like my job).

This time the problem was this:

  1. Let T be a table with columns C and X.
  2. Let the column E be of an enum type with a short, static defined values E1, E2, E3.
  3. Let the column X be a space separated list of tokens (values look like „ABC“, „ABC DEF“, „XUT OSH OJR“, with an arbitrary number of tokens).
  4. We look for the following information:
    For a given token x in the values of X get a tuple R = (#(E1), #(E2), #(E3)), where #(Ei) denotes the number of rows in T, where x is included in X and the row has value Ei in column E.

Mapping an Pivot Query in EntityFramework6 weiterlesen

Ozcode’s export object(s) feature, a first review (part 1)

Nearly half a year ago, in November 2015 I wrote a first article about a feature of the OzCode, an awesome debugging tool that plugs into Visual Studio and enhances it by many features in the debugging field I don’t want to miss again.

Recently Version 2.0 of OzCode has been published and today I finally found the time to test it in more depth. The whole article is based on OzCode version 2.0.0.1413.

For testing I wrote a very small test project with some XUnit tests. Unit testing as such is not necessary in this case, but these tests are easy to run as a single, separated piece of code, so it was the easiest way to go. The test project is published on GitHub as ozcode-export-test.

When OzCode 2.0 was announced on twitter and I asked for a test version, they finally answered (fixed the link here that was a wrong shortlink on Twitter due to missing space):

@jongleur1983 Wait is over http://o.oz-code.com/announcing-ozcode-v2.1-beta. Doesn’t address the issues you mentioned in your post yet, but we will be looking into that.

So I do not expect any issue mentioned in my first post to be addressed, but nevertheless the feature might be quite useful, so let’s give it a try.

As this article get’s lengthy again and it’s past midnight, I decided to split it, so this post is about single-object exports only for now, I’ll try to write a next one about exporting object graphs assembled from more than one object. Ozcode’s export object(s) feature, a first review (part 1) weiterlesen

Strange behaviour of String Interpolation Refactorings in VisualStudio 2015/Roslyn/Resharper

We switched to VisualStudio 2015 at work a few days ago, using Resharper inside as before. VisualStudio has some great new features in this version, a few bugs, and some strange behaviours I don’t understand.

In some articles I’m going to talk about some strange refactoring suggestions I discovered, starting with string interpolations here.

Just to ask beforehand: Is there any way to identify where a refactoring comes from (is it a suggestion and/or implementation of Roslyn or Resharper?) Strange behaviour of String Interpolation Refactorings in VisualStudio 2015/Roslyn/Resharper weiterlesen

Open Question: How to always run a custom tool in Visual Studio on Project Build?

In a project at work we have some T4 templates running in a Visual Studio (2015) environment. Those templates should run whenever some dependent files have changed. As it’s kind of a compilation step, a best fit, I thought, would be to run the templates on every (re-)build of the project, but how to achieve that? Open Question: How to always run a custom tool in Visual Studio on Project Build? weiterlesen

IEnumerable, ICollection, IReadOnlyCollection – an API analysis on .NET and XUnit

Today for the first time since I use XUnit I wrote a theory where the individual test parameters could not be easily defined as compile time constants.

In the next chapter I’m going to explain the motivation and the use case that arose here, before the next chapter will try to give a summary over the .NET API that’s behind that issue and what’s wong with it. IEnumerable, ICollection, IReadOnlyCollection – an API analysis on .NET and XUnit weiterlesen

Ozcode upcoming feature tweet: serializing objects for debugging

Currently oz_code asks about what developers want to see in future versions of their Visual Studio extensions to simplify and enhance debugging experience.

We use oz_code at work for complex .NET/WPF desktop applications and it is an invaluable tool for various use cases while debugging.

Today I read this tweet from @oz_code:

Would you like to be able to serialize objects from your debugging session and then use those objects in a Unit Test? (feature planning)

And I didn’t have to think twice about it: yes! But it didn’t take a minute thinking about what would be possible – and was a developer myself: What might be challenges of such a feature (even though I don’t have to implement it myself).

Ozcode upcoming feature tweet: serializing objects for debugging weiterlesen