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.
Tag: entity framework
N-Layered App with Entity Framework, Autofac, ASP.NET MVC and Unit Testing
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:
Say No to the Repository Pattern in your DAL
Repositories On Top UnitOfWork Are Not a Good Idea
Why Entity Framework renders the Repository pattern obsolete?
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.
Generic Repository and Unit of Work Pattern, Entity Framework, Unit Testing, Autofac IoC Container and ASP.NET MVC [Part 4]
This is the summary post of the series. I would recommend you to read following posts first:
1. Implementing Generic Repository and Unit of Work Pattern With Entity Framework
2. Dependency Injection in ASP.NET MVC using Autofac and CRUD operations
Generic Repository and Unit of Work Pattern, Entity Framework, Unit Testing, Autofac IoC Container and ASP.NET MVC [Part 2]
In my previous post, I created models, repository and service layer. Now we will implement CRUD operations using these layers and setup Autofac IoC Container.
I would recommend you to read previous post first if you have not read.
Generic Repository and Unit of Work Pattern, Entity Framework, Unit Testing, Autofac IoC Container and ASP.NET MVC [Part 1]
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.
Getting and Displaying The Nearest N Places On a Map in ASP.NET
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.
HTML5 Geo-Location, SQL Server Geography Data Type, Entity Framework and ASP.NET
In this article, we will implement to save current geo-location(latitude, longitude) of user in Sql Server Geography data type column using Entity framework and ASP.NET Web Form.
Carousel Image Gallery With AngularJS UI Bootstrap And ASP.NET MVC
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.
Cascading DropDownList with AngularJS and ASP.NET MVC
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:
Combine Images into Facebook Style Collage in ASP.NET Web Forms
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.