Tag: entity framework

This tutorial explains the following things in ASP.NET MVC: 1. How to upload multiple files using HTML5 multiple file input with additional model data. 2. How to save files to a specific path on the server (Not in database). 3. How to allow to upload file with same name. Different users can upload files with same name. 4. How to download the uploaded file. 5. How to manage files in edit mode. 6. How to use Entity Framework for CRUD operations with parent child table structure.

In my recent post, I explained how to implement a decoupled, unit-testable, N tier architecture based on Generic Repository Pattern with Entity Framework, IoC Container and Dependency Injection in ASP.NET MVC, then I got feedback against the repository/Unit of Work pattern. On googling, I found some more posts:

Entity Framework already implements a repository pattern. Implementing another layer on top of this is not only redundant, but makes maintenance harder. You might want to mock your Entity Framework context rather than using the repository pattern. This post explains how you can implement N Layered app without repository/unit of work pattern on top of EF.

In this post, we will see how to implement a decoupled, unit-testable, N tier architecture based on Generic Repository Pattern with Entity Framework, IoC Container and Dependency Injection in ASP.NET MVC. We will implement a sample application step by step for the same.

In my previous tutorial, we implemented to save Geolocation (latitude, longitude) in Geography data type column in Sql Server. Now, we will get the nearest N places from the current geo-location of user.

This article explains how to implement carousel image gallery with AngularJS UI Bootstrap and Entitiy Framework database first approach in ASP.NET MVC. Angular UI Bootstrap repository contains a set of native AngularJS directives based on Twitter Bootstrap’s markup and CSS. As a result NO dependency on jQuery or Bootstrap’s JavaScript is required. We will follow these steps to implement carousel: 1. Create a method to get image path, title and summary from database using EF. 2. Call the above method in AngularJS and set response to property. 3. Use <carousel>,<slide> elements with the bindings in the view to display carousel.

This article explains how to create cascading dropdownlists with AngularJS, Entity Framework Database First approach in ASP.NET MVC. We are going to implement Country, State dropdownlists. 1. Assuming you have added “ADO.NET Entity Data Model“(.edmx) in the project for your database. Consider the following structure in edmx:

Facebook home page displays a collage of random profile photos which makes it something special. So I decided to implement the same thing in ASP.NET. In this tutorial, we will do following things: 1. To get random image names from database using Entity Framework Database First approach. 2. Calculate the total needed images for a given width and height. Assuming all profile images have same size. 3. Combine multiple images into collage using C# graphics 4. Add borders to differentiate images 5. Create linear horizontal opacity gradient for the collage and add it in a page similar to Facebook.

ASP.NET MVC 4 web application allows users to log in from an external provider, such as Facebook, Twitter, Microsoft or Google and then integrate into your web application. Some OAuth/OpenId providers like Facebook, Google allow to access email. This article explains how to save the email in your database.

Before implementing, first lets consider following points:

1. User name is different from Email. 2. Email might be different for different providers. 3. Email is optional(some external provider like twitter doesn’t allow to access email).

In this article, We will implement CRUD (Create, Read, update and delete) operations with Knockout.js, ASP.NET Web API, Entity Framework 5.0 Database First Approach. For Add or Edit operation, A modal dialog having WYSIWYG Html editor is used. User can enter information and submit it. It should look like the image below:

SkyDrive provides the excel survey feature which allows you to create online surveys and analyze results using the free Excel Web App or Excel on your desktop. You can display the survey results by embedding the excel in a web page. ExcelMashup.com allows you show a workbook directly in your website. It also lets you easily sort, filter, and interact with the workbook as in Web Excel with powerful Javascript API. We will create a sample survey and save result data to database using ASP.NET MVC and Entity Framework.

To update an entity in ASP.NET Web API, PUT request is used and we have to send all the properties even if only a subset have changed means if only one field is updated on the client side, we have to send the entire model back to the server to make an update. It’s not a cool way. PATCH request allows you to send just the modified properties for partial model updates. It reduces complexity in case of bigger tables. Here is a usage example to implement HTTP Patch request in ASP.NET Web API to update data with EF DB First.