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

  • Home
  • SEARCH
  • 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 6931511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:35:15+00:00 2026-05-27T11:35:15+00:00

I am receiving the following error: System.InvalidOperationException was unhandled Message=The type ‘Judge’ is not

  • 0

I am receiving the following error:

System.InvalidOperationException was unhandled Message=The type
‘Judge’ is not attributed with EdmEntityTypeAttribute but is contained
in an assembly attributed with EdmSchemaAttribute. POCO entities that
do not use EdmEntityTypeAttribute cannot be contained in the same
assembly as non-POCO entities that use EdmEntityTypeAttribute.
Source=EntityFramework StackTrace:
at System.Data.Entity.Internal.InternalContext.UpdateEntitySetMappingsForType(Type
entityType)
at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type
entityType)….

 public class GenericRepository<TEntity> where TEntity : class
{
    internal z context;
    internal DbSet<TEntity> dbSet;

    public GenericRepository(z context)
    {
        this.context = context;
        this.dbSet = context.Set<TEntity>();
    }

    public GenericRepository()
    {
        this.context = new z();
        this.dbSet = context.Set<TEntity>();
    }

    public virtual IEnumerable<TEntity> Get(
        Expression<Func<TEntity, bool>> filter = null,
        Func<IQueryable<TEntity>, IOrderedQueryable<TEntity>> orderBy = null,
        string includeProperties = "")
    {

        IQueryable<TEntity> query = dbSet;

        if (filter != null)
        {
            query = query.Where(filter);
        }

        foreach (var includeProperty in includeProperties.Split
            (new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
        {
            query = query.Include(includeProperty);
        }

        if (orderBy != null)
        {
            return orderBy(query).ToList();
        }
        else
        {
            return query.ToList(); //Getting error here!!
        }
    }

    public virtual TEntity GetByID(object id)
    {
        return dbSet.Find(id);
    }

    public virtual void Insert(TEntity entity)
    {
        dbSet.Add(entity);
    }

    public virtual void Delete(object id)
    {
        TEntity entityToDelete = dbSet.Find(id);
        Delete(entityToDelete);
    }

    public virtual void Delete(TEntity entityToDelete)
    {
        if (context.Entry(entityToDelete).State == EntityState.Detached)
        {
            dbSet.Attach(entityToDelete);
        }
        dbSet.Remove(entityToDelete);
    }

    public virtual void Update(TEntity entityToUpdate)
    {
        dbSet.Attach(entityToUpdate);
        context.Entry(entityToUpdate).State = EntityState.Modified;
    }

    public virtual void Save()
    {
        context.SaveChanges();
    }
}

The weird part is Judge is attributed with the EdmEntityTypeAttribute, because it is automatically generated as part of the DbContext T-4 jazz.

    /// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmEntityTypeAttribute(NamespaceName="standaloneModel", Name="Judge")]
[Serializable()]
[DataContractAttribute(IsReference=true)]
public partial class Judge : EntityObject
{

At one point I did have another class Judge in a different assembly, but I have since renamed it. I have tried cleaning both projects. There should be no other Judge class besides the EF one.

So I can not figure out where this other Judge class is coming from??

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-05-27T11:35:15+00:00Added an answer on May 27, 2026 at 11:35 am

    Figured it out.

    When I first started the program I was using an ObjectContext with the .edmx.

    Then I read about EF 4.2 and decided to use DbContext.

    The problem was my .edmx file was generating classes, as well as the DbContext T-4s.

    The solution was to turn off code generation in the .edmx.

    So now, only the DbContext T-4s are generating my POCO classes.

    Hope this questions helps someone else in the future!

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

Sidebar

Related Questions

Receiving the following upon call to hostContainer.ComposeParts() : System.ComponentModel.Composition.ChangeRejectedException was unhandled Message=The composition remains
I am receiving the following error: Cannot implicitly convert type 'System.Collections.Generic.IEnumerable' to 'Munchkin.Model.PlayerProfiles.Profile'. An
I'm trying to implement my own GenericIdentity implementation but keep receiving the following error
I am receiving the following error but can't seem to make sense out of
Background I'm receiving the following error when trying to render a partial view in
I am receiving the following error in PHP Notice undefined offset 1: in C:\wamp\www\includes\imdbgrabber.php
I am receiving the following error in my code (c#, .Net 3.5, VS2008) when
I'm receiving the following error when deploying a feature containing ASP.NET pages to our
I am receiving the following error when browsing my asp.net page in internet explorer.
I am getting the following error in my code: System.JSONException null Don't know the

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.