Showing posts with label Entity Framework. Show all posts
Showing posts with label Entity Framework. Show all posts

Thursday, June 25, 2015

A N-Tier Architecture Sample with ASP.NET MVC3, WCF, and Entity Framework


N-Tier software architecture can solve the following client/server system issues: scalability, security, fault tolerance and etc. In our previous article "N-Tier Architecture and Tips" we introduce the basic N-Tier architecture concepts and some practical tips. In this article, we try to elaborate a N-Tier architecture sample with ASP.NET MVC3, WCF and Entity Framework. In Java, usually there is a pre-defined way to achieve the N-Tier architecture: J2EE architecture, which uses session bean over entity bean for business and persistence layer, Java bean, servlet or JSP for the client presenter layer, Java Swing, HTML or applet as the client side. Therefore, for J2EE, different application are very likely implemented in very similar ways. However, in .NET, even though there are many tools and features available, there isn't any pre-defined way as J2EE does to guard how to implement the N-Tier architecture. As a result, there are too many inconsistent and existing ways to do this. Some are good; some are bad. This article tries to introduce a decoupled, unit-testable, deployment-flexible, implementation-efficient and validation-flexible N-Tier architecture in .NET. What we achieved here is to put some well-known nice tools and features in .NET together and come up with a workable solution. Because there is too much to cover in one article, we will mainly concentrate on business and persistence layers of N-Tier architecture in our sample solution, but will still briefly touch other layers too. In order to understand better this article, we suggest you to read first our previous article on the basics of N-Tier architecture here. As our previous article, this article is also based on the assumption that a team has a full control over all layers of the N-Tier architecture.


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,VS2012,.Net,Articles,Computer Tutorials,ASP.Net,MVC,Entity Framework,WCF,N-Tier

Tuesday, May 13, 2014

Understanding Repository and Unit of Work Pattern and Implementing Generic Repository in ASP.NET MVC using Entity Framework


I remember the .NET 1.1 days when we have to spend a considerable amount of time in writing the data access code for every application. Even though the nature of the code was almost the same, the difference in database schema made us write the separate data access layer for every application. With newer version of .NET frameworks, the possibility of being able to use ORMs(Object Relational Mapper) in our application saves us from writing lot of code that was earlier needed to be written for data access. Since the ORMs make data access so straight forward that there is a possibility of having data access logic/predicates scattered all across the application. For instance, every controller can have the needed ObjectContext instance and can perform data access. Repository and Unit of work pattern provides a clean way to access data using ORMs, keep all the data access logic in one central location and at the same time maintain the test-ablility of the application. Instead of talking about what a repository and unit of work is, let us try to understand these by implementing a simple ASP.NET MVC application.


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, MVC4,Entity Framework

Thursday, March 6, 2014

Entity Framework - Sample Application for Beginners


In this article, we will learn the basics of Entity Framework by creating a sample application. This tip is for the programmers who have some experience in creating ASP.NET applications, but are new to Entity Framework. Here I will explain:


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,VS2012,.Net,Articles,Computer Tutorials,Entity Framework

Wednesday, March 5, 2014

A basic SPA application using AngularJS,WebAPI and Entity Framework


SPA which stands for Single Page Application is the latest trend in web application development.It is a web application that load a single HTML page initially and is dynamically updated as the user interacts with the application. In this article we will see the requirement for SPAs and explore the technologies we can use to create a Single Page Application.We will also see how to create a basic application using AngularJS ,WebAPI and Entity Framework.


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,VS2012,.Net,Articles,Computer Tutorials,AngularJS,WebAPI,Entity Framework

Monday, January 27, 2014

Implementing Password Reset in MVC 4 EF Code First using Simple Membership – Part 2


I apologize for the long delay between part 1 and part 2, but I've been really busy. I've created 2 new jQuery plugins (scrolling related) and I've put out my own RWD Grid Framework called Bare Bones. Check them out! So it took me a while to figure out where we left off and what the next step is. Before you continue with this tutorial, you should already have a working copy of where we ended up with Part 1: an extended account model that allows for email entry. That was the hard part. In Part 2, I'm going to explain how to use WebSecurity.GeneratePasswordResetToken that will create a token used to reset a user's password. This is currently the most common way to recover a password: an email is sent to the user's verified email address with a link the user can use to reset their password.


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, MVC4, Entity Framework, Code First

Thursday, January 16, 2014

AutoCompleteExtender with WCF using Entity Framework


AutoCompleteExtender is an extender available in AjaxControlToolkit which can be attached to any TextBox control.When user enters a characters in TextBox which is extended by AutoCompleteExtender, AutoCompleteExtender pulls out the words that starts with the contents of the TextBox from database or specified memory location and display them in popup list. It enables ASP.NET TextBox control to behave like a search box.


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,WCF,Entity Framework,AutoCompleteExtender

Monday, January 13, 2014

Code First Goodies in Entity Framework 6


Julie LermanIn my December 2013 article, "Entity Framework 6: The Ninja Edition" (msdn.microsoft.com/magazine/dn532202), I described many of the new features in Entity Framework 6 (EF6). I wasn't able to delve into every feature, though, so this month I'll drill into some of the EF6 enhancements specific to Code First. Two of the features I'll discuss are relevant to Code First mappings, and the others relate to Code First migrations.


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,Entity Framework 6,Entity Framework,Code First Goodies

Tuesday, December 3, 2013

Repository Pattern and Unit of Work with Entity Framework in ASP.NET MVC


Repository pattern is used to create an abstraction layer between data access layer and business logic layer. This abstraction layer contains the data manipulation methods which are communicating data access layer to serve data as per business requirement to logical layer. The main purpose is to create this layer for isolating data access layer so that any changes cannot affect business logic layer directly. For example, a POS application is usually deployed to different stores. Few new clients want to use Microsoft SQL Server database system and others want Oracle or any other database. Also they have few different relationship database systems to store their data but business logic is almost the same. Then this Repository pattern will help the developers to detach the layer and add new data access layer. Unit of work is a pattern to handle the transaction during data manipulation using repository pattern. So we can say according to Martin Fowler, Maintains a list of objects affected by a business transaction and coordinates the writing out of changes and the resolution of concurrency problem. Implementing these patterns can help insulate the application from changes in the data store and also gives advantages to automate unit testing. Though, these patterns are widely used for DDD but it facilitate for TDD also.


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, MVC4,ASP.Net,Repository Pattern,Unit Of Work,Entity Framework

Monday, November 25, 2013

Entity Framework Important Interview Questions


These are most of the important interview questions asked while .Net and Entity Framework interviews. Please have a look at these, let me know in comments if you need answers of these.
  • What is Entity framework?
  • What's the difference between LINQ to SQL and Entity framework?
  • What are CSDL, SSDL and MSL?
  • What is the work of EDMX file?
  • How can we browse using entity framework classes?
  • How can we add, update and delete using EF?
  • How can we use stored procedures in entity frame work?
  • What are POCO classes in Entity framework?
  • How to implement POCO in entity framework?
  • In POCO classes do we will need EDMX files?
  • What is code first approach in entity framework?
  • How can implement code first in entity framework?
  • What is the difference between POCO, code first and simple EF approach?
  • How can we handle concurrency in Entity framework?
  • How can we do pessimistic locking in Entity framework?
  • What is client wins and store wins mode in entity framework concurrency?
  • What is Lazy Loading in Entity framework?
  • How can we turn off lazy loading?
  • What are navigation properties in Entity framework?
  • What are complex types in Entity framework?

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,Entity Framework, Entity Framework Interviews, Interviews Questions

Sunday, October 20, 2013

Learning MVC - Part 5 Repository Pattern in MVC3 Application with Entity Framework


In our last four articles, we learnt almost everything about how to create an MVC application and how to communicate with database using the same application. In the third part of learning MVC, we learnt communication between MVC application and database using EntityFramework, so I am referring to the same context. In this article, I'll focus on how to implement a Repository Pattern in the same MVC application, therefore moving ahead a step towards architectural approach of developing an enterprise application.


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

</ span>C#,.NET,Architect,Intermediate,VS2010,.Net,Articles,Computer Tutorials, MVC, MVC3,Entity Framework

Sunday, October 6, 2013

SqlCommand: The Entity Framework alternative to access databases


SqlCommand is the alternative way to query, insert, update or delete database data. We have seen in lot's of other posts on this blog, how to execute CRUD operations on a database using the Entity Framework and more specifically an instance of the DbContext class. We have also shown how to map stored procedures in an entity, a post you can read here. Mind though that if you want to know exactly what is executed in the database using the Entity Framework, you have to be a guru on that area. Entity Framework may simplify data accessing but as always what gained in simplicity is loosed in performance. For example by default, when you query an entity, all of it's properties are filled even the navigation ones. But what if you only wanted some of those? The alternative solution is to use classes such as SqlConnection and SqlCommand. You can pass exactly the query you want to be executed in database level, either this is a CRUD statement, a View or even a Stored Procedure. Here's what we gonna see on this post:


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,Entity Framework,.Net,Articles,Computer Tutorials,SqlCommand

Thursday, October 3, 2013

Related entities and live search with Web API and Entity Framework


Retrieving and manipulating Entities with no related data using Web API and Entity Framework is quite easy and most times, by the time you create a Web API controller using a specific Model class and a DbContext instance you won't have to alter the the code created for you. If you aren't aware of what DbContext is there are a few posts on this blog that will help you. Fetching and manipulating related entities is a little bit different. You need to know exactly how your Model classes are structured which means you need to be aware of any relationships exist in database level and how Entity Framework structured your model classes as well. In this post we are going to show how to:


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,Entity Framework,Web APIs

Wednesday, October 2, 2013

Map CRUD Stored Procedures to Entities with Entity Framework


There are a few different ways to execute a Stored Procedure through a C# application, each of them following different principles. One of the most used approach is to use an SqlCommand object of type CommandType.StoredProcedure and invoke it's ExecuteReader() function. Entity Framework though, allows you to implicitly or explicitly execute a Stored Procedure through it's entities. The reason why I said implicitly or explicitly has to do with the way you will eventually execute the stored procedure. Let me explain a little farther about this. Suppose you have a DbContext Model class generated from your database and you have a table named "Products". You also have created 4 stored procedures, the GetAllProducts, InsertNewProduct, UpdateProduct and DeleteProduct. Those stored procedures can be executed in two different ways with Entity Framework. You can "bind" the GetAllProducts stored procedure which is a select statement, directly to you DbContext class so you can execute it writting something like this:


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,VS2012,.Net,Articles,Computer Tutorials,Entity Framework

Storing images in SQL Server using EF and ASP.NET


This article was actually driven by the demand of knowledge about this subject in the forum. Questions about how to store binary data (images) in a SQL Server database and how to retrieve them, and event return the image with ASP.NET (MVC) to display on a website.


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, ASP.Net,Entity Framework,SQL Server

Tuesday, June 18, 2013

MVC 4, Web API, OData, Entity Framework, Kendo UI, Grid, Datasource (CRUD) with MVVM – Part 2


Let's start off where we left off from my previous blog MVC 4, Kendo UI, SPA with Layout, View, Router & MVVM – Part 1. In this post, we'll cover how to wire up a Kendo UI Grid and Datasource in our SPA with MVVM using OData.


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

</ span>C#,.NET,Architect,Intermediate,VS2010,.Net,Articles,Computer Tutorials, MVC, MVC4,Web APIs,OData,Entity Framework,,Kendo UI,MVVM

What is Eager Loading and what is Lazy Loading and what is N+1 Problem in Entity Framework


In this post you will learn what Eager Loading is and what Lazy Loading is and how this works in the application, and how you can take its advantages. With Entity Framework we have various patterns that you can use to load related entities. As you know, entity types can define navigation properties that represent associations in the data model and you can use these properties to load


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

</ span>C#,.NET,Architect,Intermediate,VS2010,.Net,Articles,Computer Tutorials,Eager Loading,Lazy Loading,Entity Framework

Friday, June 14, 2013

Modern Web Application Layered High Level Architecture with SPA, MVC, Web API, EF, Kendo UI


Search and searched and seems difficult to locate any comprehensive full blown, top down, architecture or high level design diagrams for modern (SPA) web apps. It's probably important you have at least a high level picture what this architecture looks like now that there is quite a bit more design work involved on the client side especially with more and more implementations are around SPA and patterns like MVVM; so hence this post. Obviously you can omit or add to the architecture based on your specific requirements.


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

</ span>C#,.NET,Architect,Intermediate,VS2010,.Net,Articles,Computer Tutorials,Modern Web Application,SPA,MVC,Web APIs,Entity Framework,Kendo UI

Wednesday, May 29, 2013

Model First CRUD operations


Model First CRUD operations Introduction This article demonstrates one of interesting and most useful concept in Entity Framework Model – Model First CRUD operations. Question: What is Model First? In simple terms "In Model First approach, the Entities, relationships, and inheritance hierarchies are directly created on the design surface of EDMX". In this article, Model First […]


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

</ span>C#,.NET,Architect,Intermediate,VS2010,.Net,Articles,Computer Tutorials,Model First,Entity Framework

Database First CRUD operations using Stored Procedures


Database First CRUD operations using Stored Procedures Introduction This article demonstrates one of interesting and most useful concept in Entity Framework Model – Database First CRUD operations using stored procedures. Question: What is Database First? In simple terms a Database First allows you to reverse engineer a model from an existing database or create a database […]


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

</ span>C#,.NET,Architect,Intermediate,VS2010,.Net,Articles,Computer Tutorials,Database First,Entity Framework

Sunday, May 26, 2013

How to build a single entity CRUD grid with AngularJS, WebAPI, Entity Framework (EF), Bootstrap, Font Awesome & Toastr


Here's how I built a quick single entity CRUD grid with AngularJS, WebAPI, Entity Framework, Bootstrap, Font Awesome & Toastr. I spent a more time than I should have getting this all wired up, so I thought I'd share the code to save you some time. It's not perfect – but should be a good starting point for you.


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

</ span>C#,.NET,Architect,Intermediate,VS2010,.Net,Articles,Computer Tutorials,angularjs, bootstrap, entity framework, font awesome, toastr, webapi

LinkWithin

LinkWithin

Like Us On Facebook and Receive All Updates!

You can also receive Free Email Updates:

Powered By Tutorails