PS: English version is at the bottom. The type arguments for method ‘IModelExpressionProvider.CreateModelExpression<TModel, TValue>(ViewDataDictionary<TModel>, Expression<Func<TModel, TValue>>)’ cannot be inferred from the usage. Try specifying the type arguments explicitly. Hata 3 tane gorunuyor. Ne bir satır numarası var ne bir başka detay. Sadece hatanın hangi ekranda olduğunu gösteriyor. Ama çift tıklıyorum her hangi bir satıra da […]
Zipping your files
There is an open source project to use with your projects. It’s easy to use. dotnetzip.codeplex.com Let’s zip a folder 🙂 Happy coding…
A Big step to self documented code
You can always write comment to your codes. But comment itself can be outdated and misleads a developer. So writing self-documented codes must our first aim to make our code more maintainable. In my opinion a big step to achieve self-documented code begins writing if clauses. If a developer understands if clause, he/she understand purpose […]
Serialize your objects to XML
This is sample application to serializes sample object Output string: Sample class to use:
Using clipboard with console applications
Clipboard is a windows object. If you want to use clipboard in your .NET framework console applications you must reference `System.Windows.Forms` and mark your main method with `STAThreadAttribute` attribute. Then you can use this class's methods e.g. Clipboard.SetText("some text to store in the clipboard"); Happy coding.
Visual Studio 2008 Apply Cutting To Blank Lines
While we are coding we used to delete blank lines with ‘Shift + Del’. Shift + Del shortcut is same as ‘Ctrl + X’. And if you copy something to clipboard before cutting the blank lines, it will be replaced by the blank line. You can change this behaviour with VS 2008 settings. Tools > […]
JSON serialization and deserialization
JSON stands for Javascript Object Notation and this is the new lightweight (then XML) standart for transferring data from one point to another over the network. Here you can find a sample web page codebehind to see usage in C#. Static methods in ‘Functions‘ class Happy codings…
Timespan and Databases
When you are developing application you may need to store timespan database. (Assuming you are using Sql Server 2005) TimeSpan.TotalSeconds can be used to store. This returns a double. And maps to decimal data type of the sql server. For reverse action to get the time span you can use TimeSpan.FromSeconds method. This will give […]
Converting a List of Inherited Type to a List of Base type
For example you have a base class and a class that inherits it like below. And you have generic list of these types. Then if you want to convert List<B> to List<A> You can use this code block: Happy coding.
ASP.NET MVC 1.0 RC (Release Candidate)
Milliyet gazetesi Internet yazılım hizmetlerinde çalışmaya başladığımda arabam.com web sitesinin mevcut veritabanı ve sınıf kütüphanesi kullanılarak yeniden yazılamsı isteniyordu… .NET 1.1 de geliştirilmiş olan mevcut uygulamayı yeni teknolojilerle yazalım istedik… Visual Studio 2008 + .Net Framework 3.5 + MVC Framework Preview ile geliştirme yapma kararı alındı… Özellikle preview durumda olan bir framework kullanmak oldukça çılgın […]