Ir ao conteúdo
  • Cadastre-se

Problema ao usar entity


pkl2000

Posts recomendados

Alguem poderia me explicar esse problema e me dizer como resolver?

 

 

System.Data.Entity.ModelConfiguration.ModelValidationException was unhandled
  HResult=-2146233088
  Message=One or more validation errors were detected during model generation:

ProjetoMaisSaude.models.cadastrarConsulta: : EntityType 'cadastrarConsulta' has no key defined. Define the key for this EntityType.
Consulta: EntityType: EntitySet 'Consulta' is based on type 'cadastrarConsulta' that has no keys defined.

  Source=EntityFramework
  StackTrace:
       em System.Data.Entity.Core.Metadata.Edm.EdmModel.Validate()
       em System.Data.Entity.DbModelBuilder.Build(DbProviderManifest providerManifest, DbProviderInfo providerInfo)
       em System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection)
       em System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext)
       em System.Data.Entity.Internal.RetryLazy`2.GetValue(TInput input)
       em System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
       em System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
       em System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
       em System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
       em System.Data.Entity.Internal.Linq.InternalSet`1.ActOnSet(Action action, EntityState newState, Object entity, String methodName)
       em System.Data.Entity.Internal.Linq.InternalSet`1.Add(Object entity)
       em System.Data.Entity.DbSet`1.Add(TEntity entity)
       em ProjetoMaisSaude.fr_marcar.button1_Click(Object sender, EventArgs e) na c:\Users\paulo\Desktop\Nova pasta (6)\tcc\Nova pasta\ProjetoMaisSaude\ProjetoMaisSaude\fr_marcar.cs:linha 56
       em System.Windows.Forms.Control.OnClick(EventArgs e)
       em System.Windows.Forms.Button.OnClick(EventArgs e)
       em System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       em System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       em System.Windows.Forms.Control.WndProc(Message& m)
       em System.Windows.Forms.ButtonBase.WndProc(Message& m)
       em System.Windows.Forms.Button.WndProc(Message& m)
       em System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       em System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       em System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       em System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       em System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       em System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       em System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       em System.Windows.Forms.Application.Run(Form mainForm)
       em ProjetoMaisSaude.Program.Main() na c:\Users\paulo\Desktop\Nova pasta (6)\tcc\Nova pasta\ProjetoMaisSaude\ProjetoMaisSaude\Program.cs:linha 23
       em System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       em System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       em Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       em System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       em System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       em System.Threading.ThreadHelper.ThreadStart()
  InnerException: 
 

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novas respostas.

Sobre o Clube do Hardware

No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas comunidades sobre tecnologia do Brasil. Leia mais

Direitos autorais

Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais

×
×
  • Criar novo...

 

GRÁTIS: ebook Redes Wi-Fi – 2ª Edição

EBOOK GRÁTIS!

CLIQUE AQUI E BAIXE AGORA MESMO!