Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8041389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:12:07+00:00 2026-06-05T04:12:07+00:00

I have an Entity Framework Code First MVC3 solution where I have an entity

  • 0

I have an Entity Framework Code First MVC3 solution where I have an entity named Settings where I only have 1 record in it. This entity is used to store general settings for the solution.

public class Settings
{
    public bool   CommunicationActivated { get; set; }
    public string CommunicationMessage { get; set; }
    ...
}

When I run the solution, I got the error: System.Data.Edm.EdmEntityType: : EntityType ‘Settings’ has no key defined. Define the key for this EntityType.

My question: is it possible to have an entity without key defined? Is it a good idea for an entity with only one record?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T04:12:09+00:00Added an answer on June 5, 2026 at 4:12 am

    I recommend that you just add a new column:

    ID INT NOT NULL IDENTITY PRIMARY KEY
    

    This does no harm and allows you to work with the tools, not against them.

    You can even ensure that the table only has one record: Set the ID field manually to 1 and add a check constraint for (ID = 1).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following classes in an Entity Framework 4.3 Code-First Model for MVC3:
I have an Entity in Code First Entity framework that currently looks like this:
I'm running into an issue with Entity Framework code-first in MVC3. I'm hitting this
I am using MVC3 with Entity Framework Code First. I have the following model.
I have developed a project using MVC3 and Code first Entity Framework 4.0 as
I have an ASP.NET MVC3 application, where I use Entity Framework 4.3 Code-First and
I have an ASP.NET MVC 3 application using an Entity Framework (4.3.1) Code First
I have an issue in entity framework code first, three table in database as
I'm using Entity Framework Code First v 4.3.0 I have a two entities with
My DAL is based on Entity Framework Code First. I have a post model

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.