|
Mirrored Weblogs
-
A MIME type is a two-part identifier for file formats and format contents transmitted on the Internet. It consists of a type, a sub-type and optional parameters. When publishing a new website in Azure WebSites, you may find out that not all file types can be served without some prior configuration. For example, if your site needs to serve custom fonts, either for icons......
|
-
This is the second post in a series of posts regarding passing multiple models in a view.You can find the first one here We do know that in any MVC application we cannot pass multiple models from a controller to a single view. In this post I will provide you with a workaround for passing multiple models in a single view in MVC. In object-oriented and functional programming, an immutable object is an object whose state cannot be modified after it is created. A Tuple object is an immutable, fixed-size and ordered sequence object. It is a data structure that has a specific number and sequence of elements. The .NET framework supports tuples up to seven elements. Strings and other concrete objects are typically expressed as immutable objects to improve readability and runtime efficiency in object-oriented programming. I am going to use EF as my data access layer. More specifically I will use the Database First approach in EF. Entity Framework is an object-relational mapping (ORM) framework for the .NET Framework. EF...
|
-
We do know that in any MVC applicatin we cannot pass multiple models from a controller to a single view. In this post I will provide you with a workaround for passing multiple models in a single view in MVC. There are several approaches to achieve this but I will use the List<object> and the object object. I am going to use EF as my data access layer. More specifically I will use the Database First approach in EF. Entity Framework is an object-relational mapping (ORM) framework for the .NET Framework. EF addresses the problem of Object-relational impedance mismatch . I will not be talking about that mismatch because it is well documented in many sites on the Internet. Through that framework we can program against a conceptual application model instead of programming directly against a relational schema-model . 1) I will create an empty ASP.Net Application (Empty MVC applicatin) and I give it the name . I am using Visual Studio 2015 Enterprise edition, C# 5.0 and EF 5.0 version. 2) I will use the AdventureWorksLT2012...
|
-
A custom validation attribute allows you to create metadata, that you can use in the data model to validate data fields. In order to validate when a collection is null or empty, you may create a custom validation attribute, which returns false in case the object is null or empty. [crayon-56d4b8aa38fbd868986865/] You can now decorate classes using this attribute, i.e.: [crayon-56d4b8aa38ff3854591558/] Let’s assume that you have a WebAPI method test/validation, which:......
|
-
In this post I am going to provide you with a hands on example on how to handle concurrency in an EF Code First ASP.Net MVC 5.0 application. Basically I want to show you how to handle conflicts when multiple users update the same entity at the same time . You can find another post regarding concurrency with EF Database First and web forms here . When we are talking about concurrency in an application where EF acts as the data access layer, our main focus is how to make sure that the integrity of the data in the database is ensured in a multi user connected environment . Databases are very good in managing concurrent users. All the objects/entities are retrieved from the datastore into the memory. The changes we make are applied in the memory and then we flush the changes to the database. But what happens if those entities have been changed from another user in the time it took us to update them in memory?Well someone will say, "Dude, you just have to use pessimistic concurrency and your problems are solved." Well,...
|
-
In this post I am going to provide you with a hands on example on using caching in an ASP.Net MVC 5.0 application using Visual Studio 2015 and C# . More particularly I'll show you how to use the underlying ASP.net caching engine to improve the performance of an application. There is a number of different cache settings you can use.These settings are all available from the underlying ASP.net cache engine. It's the same engine that Web Forms uses. It's not something that's specific to just the MVC framework. But first things first. What is caching why do we need caching in the first place? Caching is of vital significance in any high-performance web application. Caching provides a way of storing frequently accessed data and reusing that data . It is an effective way for improving web application’s performance and user experience. The main advantages of caching include: Reduce network traffic - Content is cached at the client side, thus reducing network traffic Reduce database server round trips -Content that...
|
-
Windows PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language, built on the .NET Framework. You can search for it, using Windows Search, but probably you already have it installed on your computer. On top of the standard command-line shell, you can also find the Windows PowerShell ISE, which......
|
-
Azure Blob Storage is part of the Microsoft Azure Storage service, providing a relatively low cost service for storing large amounts of unstructured data, such as text or blobs; “blobs” stands for Binary Large Objects. A blob is a collection of binary data stored as a single entity. It typically comprises images, audio, or any other file. In this tutorial,......
|
-
-
-
-
-
As a developer you’re probably familiar with the pain of troubleshooting web applications. In Azure App Read more...
|
-
When you create an Azure website, you are automatically provided with a production slot that represents your live website. In addition, with each deployment slot, you are eligible to create up to four additional deployment slots that you may swap with the production slot or with the other non-production slots. Having this option, you can create more robust deployment workflows than just deploying your......
|
-
In order to sort a collection of objects based on another list that contains the proper order, we can create an extension method that performs a Join between these two collections and pass a func as innerKeySelector argument to allow us to sort this collection based on whatever key we want. Example [crayon-56b287338aceb734717922/] ...
|
-
I’m in the process of setting up a temporary landing page for the trafilm project, where I need apart from showing the trafilm logo to also show some text description about the project, till I set up an instance of MonoX Social CMS for it, like the one in ClipFlair’s Community website (ClipFlair Social). Since […]...
|
-
-
In a cloud environment, sooner or later, you may come across scenarios where some services might become temporarily unavailable, since you are depending, to a large extent, on network connections and external services. Usually, these are little glitches that may even be self-healing, however, in order not to ruin the user experience, you have to be prepared to handle them skillfully. Usually, in......
|
-
[crayon-56b287338b407356608560/] ...
|
-
The Microsoft Azure Storage Data Movement Library in an open source library designed for high-performance Read more...
|
-
In Azure portal, if your account contributes to other azure subscriptions, you are allowed to switch from one to another using a drop-down menu at the top left corner. Problem is that by default the name used in Azure Active Directory is “Default Directory” which seems a little confusing. In order to change it to something more meaningful you can use the old windows azure portal,......
|
-
I was setting up a new Lumia phone (with Windows Phone 8.1) and neither phone update, nor the (Here) maps downloads were working. When trying Settings / Phone Update, it was showing error 80072f8f and was pointing to http://www.windowsphone.com/en-us/how-to/wp8/basics/solutions-to-update-issues to read more info. However that error code wasn’t listed there. Wonder if there is any […]...
|
-
Since Azure SDK 2.7 for .NET App Service Tools for Visual Studio 2015 supports remote profiling for Web Apps, API Apps and WebJobs running in Azure. So, in case you want to analyze performance issues in your application there are three ways you can do it: Using Visual Studio 2015 Browsing the Azure App Service’s Site Control Management dashboard (aka kudu) Using......
|
-
At TrackingCam app (http://TrackingCam.codeplex.com) I have the following WPF code, where cbTrackingPresenter is a CheckBox control defined in my MainWindow’s XAML: private void cbTrackingPresenter_Checked(object sender, RoutedEventArgs e) { if (cbTrackingPresenter.IsChecked == true) StartTrackingPresenter(); else StopTrackingPresenter(); } Note the (redundant in my opinion) == true pattern used there. If the == true […]...
|
-
These are some quick notes on how to configure an SQL Server to Listen on a Specific TCP port. Open Run Command line and type: SQLServerManager12.msc for SQL Server 2014 SQLServerManager11.msc for SQL Server 2012 SQLServerManager10.msc for SQL Server 2008 and press Enter. To assign a TCP/IP port number to the SQL Server Database Engine In SQL Server Configuration Manager, in the console......
|
|
|
|