Q:

The entity type [class] is not part of the model for the current context

I have db on local server and I am trying to get data using Entity Framework. VS has created edmx model and connection string automatically and now when I try to access data like this: 
using (var context = new NSMASEntitiesTEST())
            {
                var mases = context.Mas;
                foreach (var mas in mases) //error on this line
                {
                    //
                }
            }

it gives me following error:
The entity type Mas is not part of the model for the current context.
But the thing is that I get this error only for tables that has one column of geography datatype (f.e. Mas). Other tables work fine.
I wonder if this problem could be caused just because of that geography datatype, beacuse I went through answers on similar questions and nothing worked for me.
In Mas.cs:
public partial class Mas
    {
        public int MasId { get; set; }
        public string MasName { get; set; }
        //...
        public Nullable<System.DateTime> MasContractSzif { get; set; }
        public System.Data.Spatial.DbGeography MasBoundary { get; set; }
    }

EDIT:
I have created 2 empty tables for testing:
First with 2 columns INT and NVARCHAR(50)
Second with 3 columns INT, NVARCHAR(50) and GEOGRAPHY
And it gives me error only when I want to access second table, so it is definitely caused by geography type.

A:

Ok I have solved it. EF 6 generates this datatype wrong.
In older versions of EF, this datatype was in System.Data.Spatial.DbGeography and EF 6 still generating geography datatype like this. But it should be System.Data.Entity.Spatial.DbGeography now.
I have just rewrited this in each class (table) that contains geography datatype and all these tables are now working perfectly.

