Skip to content

Instantly share code, notes, and snippets.

View MiniverCheevy's full-sized avatar

Shawn Doucet MiniverCheevy

View GitHub Profile
@MiniverCheevy
MiniverCheevy / DbEntityValidationExceptionTranlator.cs
Last active August 29, 2015 14:06
DbEntityValidationExceptionTranlator
public class DbEntityValidationExceptionTranlator: ExceptionTranslation
{
protected override bool TranslateException(Exception exception, IResponse response)
{
var dbException = exception as DbEntityValidationException;
if (dbException == null)
return false;
response.Message = dbException.Message;
foreach (var item in dbException.EntityValidationErrors)
{