An unhandled exception occurred while processing the request


InvalidOperationException: The entity type 'myModel' requires a primary key to be defined. If you intended to use a keyless entity type , call 'HasNoKey' in OnModelCreating

Keyless entity types


Wort [Key] vor die ID der Tabelle einfügen



        public int Idcontent { get; set; }





using System;

using System.Collections.Generic;

using System.ComponentModel.DataAnnotations;


#nullable disable


namespace CodeDocu.Models


    public partial class ContentModel


        //-------------< Class: Model_Project >-------------

        #region Variables

        //------------< Region: Variables >------------



        public int Idcontent { get; set; }

        public string Title { get; set; }

        public string TextContent { get; set; }

        public string HtmlContent { get; set; }

        public string Folder { get; set; }

        public string Keywords { get; set; }