This is not how you map a table that will only have one record.
Do it this way:
public class Configuracoes
{
[Key]
public Guid ConfiguracoesId { get; set; }
public int MaximoFilas { get; set; }
public int QtdSenhasEspera { get; set; }
public string NomeEmpresa { get; set; }
public string EnderecoEmpresa { get; set; }
}
Controller:
public class ConfiguracoesController : Controller
{
private MeuContexto context = new MeuContexto();
public ActionResult Index()
{
var configuracoes = context.Configuracoes.FirstOrDefault();
return View(configuracoes ?? new Configuracoes { ConfiguracoesId = Guid.NewGuid() });
}
[HttpPost]
public ActionResult Index(Configuracoes configuracoes)
{
if (ModelState.IsValid)
{
var configuracoesOriginais = context.Configuracoes.AsNoTracking().FirstOrDefault();
if (configuracoesOriginais != null) {
context.Entry(configuracoes).State = EntityState.Modified;
} else {
context.Configuracoes.Add(configuracoes);
}
context.SaveChanges();
return RedirectToAction("Index");
}
return View(configuracoes);
}
}
But answering the original question, it is not possible to create Models without PK. The amount of bugs simply does not pay to insist on the approach.