MVC Project from github

Source: https://github.com/thomasgalliker/EmployeeManagement

## EmployeeManagement Demo Application
This repository contains a multi-layer application which was built for demonstration purposes.
It contains a collection of patterns and services which are used in enterprise applications.
– Layered architecture
– Dependency injection using AutoFac
– Test-driven design
– EntityFramework code-first database context
– UnitOfWork and repository pattern
– Restful WCF service with JSON
– Diverse client technologies. Using DTOs to exchange information with the backend and ViewModels (MVVM) to bind model data to views.

Furthermore, the aim of this project was to show the interplay of the mentioned technologies, principles and practices.

### Missing points
– Authentication and authorization
– Cross-platform mobile clients
– Localization
– Input validation
– Filtering, grouping, sorting, paging of list items

### Helpful links

Generic repository pattern, unit of work, entity framework in MVC

http://techbrij.com/generic-repository-unit-of-work-entity-framework-unit-testing-asp-net-mvc

Autofac for MVC

http://techbrij.com/autofac-ioc-container-asp-net-mvc-di

Autofac for WebApi

http://docs.autofac.org/en/latest/integration/webapi.html

Using Web API 2 with Entity Framework 6

http://www.asp.net/web-api/overview/data/using-web-api-with-entity-framework/part-1

Dependency Injection in ASP.NET Web API 2

http://www.asp.net/web-api/overview/advanced/dependency-injection

Exception Handling in ASP.NET Web API

http://www.asp.net/web-api/overview/error-handling/exception-handling

Automated Testing of ASP.NET Web API and MVC applications

https://robdmoore.id.au/blog/2013/02/02/automated-testing-of-asp-net-web-api-and-mvc-applications/

Creating WCF REST services

http://www.codeproject.com/Articles/571813/A-Beginners-Tutorial-on-Creating-WCF-REST-Services

Using MVVMLight in a WPF application

http://www.dotnetcurry.com/wpf/1037/mvvm-light-wpf-model-view-viewmodel

Configuring Relationships with the Fluent API

https://msdn.microsoft.com/en-us/data/jj591620.aspx

ASP.NET Web API Exception Handling

http://weblogs.asp.net/fredriknormen/asp-net-web-api-exception-handling

Mvc4CustomErrorPage

https://github.com/13daysaweek/Mvc4CustomErrorPage/tree/master/ThirteenDaysAWeek.Mvc4CustomErrorPage.Web/Views

Exception Handling in WebAPI

http://www.codeproject.com/Articles/733512/Exception-Handling-in-WebAPI

Consuming WCF Services in Xamarin

http://www.nullskull.com/a/10476775/xamarin-cross-platform-application-consuming-wcf–part-1.aspx

http://nullskull.com/a/10476786/xamarin-cross-platform-application-consuming-wcf–part-2.aspx

Custom WCF message formatters (NewtonsoftJsonBehavior)

https://github.com/carlosfigueira/WCFSamples/tree/master/MessageFormatter/MessageFormatter/JsonNetMessageFormatter

http://stackoverflow.com/questions/8082231/custom-behavior-wont-register-in-my-web-config

How to add a second css class with a conditional value in razor MVC 4

Your answer (assuming this works, I haven’t tried this):

<div class="details @(@Model.Details.Count > 0 ? "show" : "hide")">

Second option:

@if (Model.Details.Count > 0) {
    <div class="details show">
}
else {
    <div class="details hide">
}

Third option:

<div class="@("details " + (Model.Details.Count>0 ? "show" : "hide"))">


https://stackoverflow.com/questions/15700741/how-to-add-a-second-css-class-with-a-conditional-value-in-razor-mvc-4
https://stackoverflow.com/questions/37836496/razor-add-class-if-condition-is-false

Binding arrays in ASP.NET MVC without index?

You don’t need to explicitly index flat data. If in your view you have

<input type='text' name='data' value='George' />
<input type='text' name='data' value='John' />
<input type='text' name='data' value='Paul' />
<input type='text' name='data' value='Ringo' />

Then in your controller you can use

public ActionResult Create(string[] data)
{
    //data should now be a string array of 4 elements
    return RedirectToAction("Index");
}

Source: https://stackoverflow.com/questions/21616052/binding-arrays-in-asp-net-mvc-without-index/21616554

url.action with query string in razor view

<script type="text/javascript">
   var src = "@Html.Raw(Url.Action("GetProductImage", new { productId = Model.Product.Id, pos = 1, size = 0 }))";
   $(document.createElement("img")).attr("src", src);
</script>


https://stackoverflow.com/questions/5872157/mvc3-url-action-querystring-generation