Archivi del mese: ottobre 2015

HttpContext GetOwinContext() outside Controller

In AccountController you can find this to access to UserManager If you need to access to ApplicationRoleManager, ApplicationSignInManager or ApplicationDbContext This is true if you write this code inside Controller because HttpContext is a property of Controller class: If you … Continua a leggere

Pubblicato in Asp.Net, MVC | Contrassegnato , , , , , | 1 commento

Region in css

Region are a great features working with source code. Is there a way to use region in css? YES! It’s a visual studio trick, you have to put this commented in css/less code. like this:

Pubblicato in Asp.Net, HTML5 | Contrassegnato , , , | Lascia un commento

Entity Framework System.Data.Entity.Validation.DbEntityValidationException: Validation failed for one or more entities. See ‘EntityValidationErrors’ property for more details

Working in EF 6.0 sometimes I receive “System.Data.Entity.Validation.DbEntityValidationException:Validation failed for one or more entities. See ‘EntityValidationErrors’ property for more details”. Using the visual studio watcher to try to understand the error, EntityValidationErrors is always null. Looking on google I found … Continua a leggere

Pubblicato in Entity Framework | Contrassegnato , , , | Lascia un commento