Snippets
3 04 2014
Welcome to a short trip to a concrete function of the .Net Framework: Path.GetTempFileName In my current project we have a lot of unit tests where a lot of temp files (created by Path.GetTempFileName) are used and a build server that builds the projects and executes the unit tests. Some week ago we noticed that […]
65536, C#, Code, exception, GetTempFileName, Limitation, Method, NET, Path, Path.GetTempFileName
2 03 2014
Today we will make a short trip to the world of Oracle. In my current project I have to do a lot with a Oracle database and some days ago I had to programmatically fill a table based on a predefined sequence for primary key. Sound simple, right? This sequence has an increment by 1000 […]
By, Connect, DUAL, Increment, Level, NextVal, Oracle, Sequence
15 01 2014
Some days ago i got the problem, that I have to use a custom dictionary with as parameter for a service – therefore it must be serializable. I found an interessting solution from “Paul Welter” at his blog (XML Serializable Generic Dictionary). But that’s not all! I had to implement the Constructors for Dictionary and […]
C#, dictionary, Generic, Interface, NET, Serializable, Snippet, XMl
5 11 2013
Today I came across a C#-feature i know for a long time, but never used in real code. I think thats about to change. 😀 First, have a look at the following lines and try to figure out what happens: How is it possible to add an object to a double? Normally it won’t even […]
16 09 2013
As I mentioned in the last post, you can’t use SlidingExpiration and AbsoluteExpiration a the same time. Thats by design. Thanks again, Microsoft. But there is a workaround. First i will present the solution and then a short and easy way to use it. The ObjectCache / MemoryCache has a nice little function called CreateCacheEntryChangeMonitor. […]
Expiration, extended method, memotycache, ObjectCache
11 09 2013
A while ago i wrote a post about the ObjectCache / MemoryCache and here is a little follow up. The ObjectCache allow you to set an expiration on an object you put into it. Thats very useful since most objects are only valid for a short time. When you want to cache a result from […]
Expiration, MemoryCache, ObjectCache
9 09 2013
The Windows Communication Foundation (WCF) is one of the best things Microsoft ever did for us. Whoever tried to build a Webservice, especially with REST and SOAP and then worked with WCF know what i mean. But today i just want to show you, how a WCF-Service can be used without an IIS and event […]
NamedPipes, REST, SOAP, standalone, WCF
7 09 2013
In Java the final-keyword on a parameter indicates that it is not changeable and in C/C++ you could use const. But in C#, there is no way (thanks Microsoft, well done ;-)) In Java and especially with the CleanCode-Paradigma the final keyword is used wherever possible to indicate that you use this variable only as […]
final, ReadOnlyCollection
4 09 2013
Its not in the genes its the environment! They are not evil just misunderstood. Yeah, ok you get it 😀 Singletons are a very special type of objects and should be treated like that. There is no general pattern to implement and no keyword to identify them. So what the heck is a singleton? A […]
2 09 2013
Sometimes its necessary to change the mousecursor of an application to show the user that something goes on. Most times we just want to show the wainting-cursor as long as an operation takes and switch then back. The first problem you’ll encouter, is exception-handling. You need to put everything into a try-finally-block to get your […]
cursor, IDisposible, OverrideCursor, singleton, using