Erreur lors de l'initilisation d'un Bddcontext
Bonjour,
je fais un tutoriel en asp.net MVC et j'ai un message d'ereur que je ne comprend .
C'est sur l'initialisation de mon bddcontext dans le fichier global.asax.cs
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| using ChoixResto.Models;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace ChoixResto
{
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
RouteConfig.RegisterRoutes(RouteTable.Routes);
IDatabaseInitializer<BddContext> init = new InitChoixResto();
Database.SetInitializer(init);
init.InitializeDatabase(new BddContext());
}
}
} |
messaged'erreur
Code:
1 2 3 4 5 6 7 8 9 10
| System.Data.Entity.Validation.DbEntityValidationException
HResult=0x80131920
Message=Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.
Source=EntityFramework
Arborescence des appels de procédure :
à System.Data.Entity.Internal.InternalContext.SaveChanges()
à System.Data.Entity.Internal.LazyInternalContext.SaveChanges()
à System.Data.Entity.DbContext.SaveChanges()
à System.Data.Entity.DropCreateDatabaseAlways`1.InitializeDatabase(TContext context)
à ChoixResto.MvcApplication.Application_Start() dans C:\Users\kribou\source\repos\ChoixRestoSolution\ChoixResto\Global.asax.cs :ligne 25 |
est ce que quelqu'un aurait une piste
Merci d'avance