Skip to main content

Posts

Showing posts with the label Articles

The model backing the context has changed since the database was created.

One possible solution is to add
Database.SetInitializer<YourDbContext>(null);
in the constructor of YourDbContext.
I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.

This article is related to
C#,.NET,Architect,Intermediate,VS2010,.Net,Articles,Computer Tutorials
​,EntityFramework​

Could not load type MvcApplication

To fix this, you have to change the output path in the build tab to bin\
I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.

This article is related to
C#,.NET,Architect,Intermediate,VS2010,.Net,Articles,Computer Tutorials
​,VisualStudio

How to Get Name of the Member (Property Name, etc.) of a .NET Class

Consider the following sample class:
public class Person() { public int PersonId { get; set; } public string PersonName { get; set; } }
For various reasons, we need the name of the properties/ field of the class in a string variable in our code.
One option which is quite easy is to use the hard-coded strings directly.
For example:
string idField = "PersonId";
But the biggest disadvantage with the above approach is that whenever a field name or property name is changed, you will need to manually search and edit such string values. If you forget, it will not give you any compile error and you will only come to know when some exception will be thrown from your code.
In order to get rid of such issues, we should avoid using hard-coded values.
.NET 3.5 or higher provides support of encapsulating methods using Func helper which we can use to find a name of the property/field.
using System; using System.Linq.Expressions; string idField = ((MemberExpression)((Expression<Func<Person, int>&…

Which version of MVC am I using?

Open web.config file and find the System.Web.Mvc assembly definition:
assembly="System.Web.Mvc, Version=3.0.0.0 ..."
It's an MVC3 as you see. Via web you can use MvcDiagnostics which is similar to phpinfo() functionality in PHP.
I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.

This article is related to
C#,.NET,Architect,Intermediate,VS2010,.Net,Articles,Computer Tutorials
​,MVC,MVC Version

DEPENDENCY INJECTION IN ASP.NET VNEXT

Microsoft changed the way how dependency injection (DI) is done in ASP.NET vNext. In previous versions of ASP.NET there were different entry points for user defined classes like the IControllerFactory for ASP.NET MVC applications or the IHttpControllerActivator for ASP.NET WebAPI applications. Starting with ASP.NET vNext DI becomes a first-class citizen in the framework through the whole stack. With showing the new DI features in ASP.NET vNext, discussions came up whether it is the correct way to do DI. In this post I like to show how DI works in ASP.NET vNext and then lead to the current discussion about it. At the end I like to ask you for your opinion.
✔ Read More...
I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to re…

Execute SQL statements in Integration Services

Executing SQL statements is one of the easiest and most common tasks that occur in SQL Server 2005 Integration Services (SSIS). This tutorial walks you through the process of adding SQL statements to your SSIS packages and bundling them into logical units of work if necessary.
✔ Read More...
I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.

This article is related to

C#,.NET,Architect,Intermediate,VS2010,.Net,Articles,…

4 Top Alternatives to YouTube for Sharing Videos

YouTube is the largest video sharing platform of the Internet world but for several reasons, a huge number of Internet users search for YouTube alternatives. Sometimes YouTube bans you for violation of TOS or the service gets blocked in your area as it happens in Pakistan frequently :), but you need YouTube for uploading and sharing your business or personal videos and this task is
✔ Read More...
I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybo…

RadOutlookBar for WPF

RadOutlookBar for WPF Introduction This article demonstrates one of interesting and most useful concept in Telerik Rad Controls for WPF Question: What is RadOutlookBar? In simple terms "It enables user combine group of items to hold as single template. It enables to create to different group of items according to respective category and navigation across the items […]
✔ Read More...
I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as…

Build Async Services with ASP.NET Web API and Entity Framework 6

If you are building web services that interact with a database, chances are they are not written in a scalable fashion. Web services based either on WCF, which supports both SOAP and REST, or on ASP.NET Web API, which exclusively supports REST, use the .NET Thread Pool to respond to requests. But just because services are inherently multithreaded does not make them scale when numerous requests are made simultaneously. The very reason why threads are pooled, instead of created on the fly, is because they are an extremely expensive resource, both in terms of memory and CPU utilization. For example, each thread consumes about 1 MB of stack space, in addition to the register set context and thread properties.
✔ Read More...
I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful…

Dependency Injection / Inversion of Control–A Concrete Example-Roll your own

How exactly does Dependency Injection work? It seemed rather mysterious to me from the implementation point of view. Some people look at a compiler and think, "Wow, that's cool how it could translate source code into machine code."
✔ Read More...
I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.

This article is related to

C#,.NET,Architect,Intermediate,VS2010,.Net,Articles,Computer Tutorials,Dependency In…

Design pattern – Inversion of control and Dependency injection

In this section we will discuss about how IOC and DI can help us build loosely coupled software architecture. I am not sure should we call this a design pattern or more of a approach. If you search around the web you will see lot of controversy on whether IOC is a design pattern or not. From my point of view it is a design pattern as it solves a problem context.
✔ Read More...
I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect …

Inversion of Control Containers and the Dependency Injection pattern

In the Java community there's been a rush of lightweight containers that help to assemble components from different projects into a cohesive application. Underlying these containers is a common pattern to how they perform the wiring, a concept they refer under the very generic name of "Inversion of Control". In this article I dig into how this pattern works, under the more specific name of "Dependency Injection", and contrast it with the Service Locator alternative. The choice between them is less important than the principle of separating configuration from use.
✔ Read More...
I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various tech…

The Onion Architecture

I've spoken several times about a specific type of architecture I call "Onion Architecture". I've found that it leads to more maintainable applications since it emphasizes separation of concerns throughout the system. I must set the context for the use of this architecture before proceeding. This architecture is not appropriate for small websites. It is appropriate for long-lived business applications as well as applications with complex behavior. It emphasizes the use of interfaces for behavior contracts, and it forces the externalization of infrastructure.
✔ Read More...
I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fie…

Peeling Back the Onion Architecture

I recently started a consulting project as an architect on an ASP.NET MVC application and quickly found myself immersed in the world of N* open source tools. MVC (which stands for Model-View-Controller) lends itself to an Agile development methodology where TDD and BDD (Test-Driven and Behavior-Driven Development) are important components. Writing applications that are testable requires that you separate business logic from presentation logic so that they can be independently tested. This is a concept known as separation of concerns (SoC), which, in addition to testability, provides other benefits, such as greater application longevity and maintainability. The life of an application is extended because loose coupling makes it easer to upgrade or replace components without affecting other parts of the system.
✔ Read More...
I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this t…

Keeping Windows 8 Tablets in Sync with SQL Server 2012

I'm pleased to announce that my newest book, "Keeping Windows 8 Tablets in Sync with SQL Server 2012," is now available for sale on Amazon. Spending a decade travelling the globe to help the world's largest companies design and build mobile solutions had taught me a few things. Large organizations are not interested in constantly running on
✔ Read More...
I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privac…

Advanced Cucumber syntax

A background section in a feature file allows you to specify a set of steps that are common to every scenario in the file. Instead of having to repeat those steps over and over for each scenario, you move them up into a Background: element. You can have a single Background: element per feature file, and it must appear before any of the Scenario: or Scenario Outline: elements. Just like all the other Gherkin elements, you can give it a name, and you have space to put a multiline description before the first step.
✔ Read More...
I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep y…

VisualStudio Tip: Configure Code Analysis in Visual Studio

I like well-written code, and I especially like it when I've written it. But I don't always live up to my own expectations. So I've used various tools (FxCop, CodeRush, ReSharper) to give me some objective feedback on the quality of my code. Starting with Visual Studio 2010, Microsoft built the latest version of their tools into Visual Studio Professional. From Visual Studio's Analyze menu, you can select Run Code Analysis on individual projects or on your whole solution.
✔ Read More...
I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest post…

Windows 8 apps: Make your GridView parallactic

Few months ago I wrote a post about a way to apply a parallactic effect to a GridView. Given that I explained the meaning of the "parallactic" term in that post, I assume you already know it. Unfortunately, the solution I explained was based on the use of a ScrollViewer to wrap a GridView. This was because the ScrollViewer exposes the ViewChanged event but the GridView don't. This is a minor issue in some cases, but lot of times the scrolling is not so smooth and fluid as the one of the GridView.
✔ Read More...
I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep yo…

How to set advanced properties for video recording in WP8

Windows Phone 8 provides a robust array of options for video recording, including CaptureSource, VideoCaptureDevice, and AudioVideoCaptureDevice. AudioVideoCaptureDevice was introduced in Windows Phone 8 and provides an extended set of capabilities and improved performance. Moreover, as it is part of the WinPRT API, it is the only interface that can be called from native code. Details can be found here. One of the most exciting features of AudioVideoCaptureDevice is that it provides advanced settings for video recording, such as H.264 encoding level, H.264 encoding profiles, video frame rate, and so on. The full list of supported settings can be found on this MSDN webpage.
✔ Read More...
I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter 

How to get the Unique Device ID in WP8 using Oxygene?

In Windows Phone 8, you can easily get the Unique Device ID using the DeviceExtendedProperties.GetValue or DeviceExtendedProperties.TryGetValue method. In order to retrieve the Unique Device ID in Windows Phone, the developer should also include the ID_CAP_IDENTITY_DEVICE capability in the WMAppManifest.xml file. When this is not included, you will receive the following message when trying to executing the code.
✔ Read More...
I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will no…