.NET Design Patterns: What they are and why we need them?

dpHi! In this article, I would like to talk about design patterns, what they are and why we need them. Do not want to show you whole list of patters because, I think, it does not make any sense from my point, I think better understating will be in case if I will show you a problem in the code and after, solution of resolving this problem by using pattern. I know, that until current time were wrote many articles about patterns and we can find hundreds of pages which describe them. But anyway, my aim in this article is to describe the concept of patterns in my vision, as simple as possible, Continue reading “.NET Design Patterns: What they are and why we need them?” »

TIP 1: How to generate random email address in C#

How to generate random email in C#Hi all, in this article I would like to show you some short bunches of code which helps you to test your amazing web applications. I definitely understand, that for Senior C# developers it can be funny and obvious, but let’s do not forget about people who just started learn C# and Selenium testing, because for them it will be not so obvious as expected :)

Let’s say that you have to generate email address to test “Create User” form. We can use standart microsoft class Random and method Next(). Please, take a look on the next code: Continue reading “TIP 1: How to generate random email address in C#” »

ASP.NET MVC: jQuery image upload and crop

ASP.NET MVC: jQuery image upload and cropThis is, probably, most used case when you have to use ajax upload of the image and after that you need to use croppind. Please, notice, in this article I described how to crop static image by using Jcrop library, in current post describes almost the same, except image will not be a static and will be uploaded by jQuery. Before reading this, I strongly recommend to read ASP.NET MVC: Crop image by using Jcrop, because in this one I will make accent only on how to upload image and how to save cropped one and will not describe cropping process. But anyway, it will be completed and working example that you can download at the end. Continue reading “ASP.NET MVC: jQuery image upload and crop” »

ASP.NET MVC: Crop image by using Jcrop

ASP.NET MVC: Crop image by using JcropHi all, I’d like to show you today very very simple example of how to crop image by using Jcrop library. Jcrop is a very powerful jQuery image cropping plugin. So, why I chose this one – because this plugin supports many browsers and devices like Google Chrome, Mozilla FireFox, IE 8 (even for IE 8 for Windows XP!), 9, 10, 11, Safari (Mac OS), iPad, iPhone and Android. To avoid confusing, especially of newbies in jQuery and ASP.NET MVC, I decided to split current topic by three separated articles. The main goal in these three articles is to show how to use Jcrop in ASP.NET MVC web application and please take a look on what will be described:

1) This post: First and very simple cropping example with static image that we already have on the page.

2) Second post: On the page we only have select file input, after selection image, system uploads file by using ajax file upload as described here and shows image on the page and after that we can crop this one.

3) Third post: The most interesting from my point, there will be all things from the second post, but only difference is that after selecting and uploading, image will be shown in the popup. And also will describe how to crop image with a big aspect ratio like 1900 x 1900 and submit data to the server. Continue reading “ASP.NET MVC: Crop image by using Jcrop” »

Visual Studio 2013: NuGet Package restoring does not work

Visual Studio 2013: NuGet Package restoring does not work Recently I have noticed very strange thing with NuGet Package Manager in Visual Studio 2013 when was trying to restore missing packages for my asp.net mvc 5 web application. At this moment I have next Visual Studio:

Microsoft Visual Studio Ultimate 2013
Version 12.0.21005.1 REL
Microsoft .NET Framework
Version 4.5.51641

Installed Version: Ultimate
Continue reading “Visual Studio 2013: NuGet Package restoring does not work” »