System.ArgumentException Message=memberTypes

Jul 9, 2014 at 3:13 PM
We're doing a database-first EF6 project. We re-updated our model from the database, adding a table we hadn't included before, and now our test init() is failing in EntitytConnectionFactory.CreateTransient().

Code:
[TestClass]
public class TestJobs
{
    private MyDbContext myDbContext = null;

    [TestInitialize]
    public void init()
    {
        string connectionString = ConfigurationManager.ConnectionStrings["MyDbContext"].ConnectionString;
        var connection = EntityConnectionFactory.CreateTransient(connectionString);

        // This requires a change to ZDbContext.context.tt
        // to add a new constructor to the generated DbContext class
        this.myDbContext = new MyDbContext(connection);
    }
    
    [...]
}
Exception:
System.ArgumentException was unhandled by user code
  HResult=-2147024809
  Message=memberTypes
  Source=Effort
  StackTrace:
       at Effort.Internal.Common.TypeHelper.GetTupleType(Type[] memberTypes)
       at Effort.Internal.DbManagement.Schema.KeyInfoHelper.CreateSelectorExpression(Type sourceType, MemberInfo[] selectorFields)
       at Effort.Internal.DbManagement.Schema.KeyInfoHelper.CreateKeyInfo(Type entityType, MemberInfo[] properties)
       at Effort.Internal.DbManagement.Schema.Configuration.PrimaryKeyConfiguration.Configure(EntityInfo entityInfo, DbTableInfoBuilder builder)
       at Effort.Internal.DbManagement.Schema.Configuration.TableConfigurationGroup.Configure(EntityInfo entityInfo, DbTableInfoBuilder builder)
       at Effort.Internal.DbManagement.Schema.DbSchemaFactory.CreateDbSchema(StoreItemCollection edmStoreSchema)
       at Effort.Internal.DbManagement.DbContainer.<Initialize>b__0(StoreItemCollection sic)
       at Effort.Internal.Caching.DbSchemaStore.<>c__DisplayClass1.<GetDbSchema>b__0()
       at System.Lazy`1.CreateValue()
       at System.Lazy`1.LazyInitValue()
       at System.Lazy`1.get_Value()
       at Effort.Internal.Caching.ConcurrentCache`2.Get(TKey key, Func`1 factory)
       at Effort.Internal.Caching.DbSchemaStore.GetDbSchema(StoreItemCollection metadata, Func`2 schemaFactoryMethod)
       at Effort.Internal.DbManagement.DbContainer.Initialize(StoreItemCollection edmStoreSchema)
       at Effort.Provider.EffortProviderServices.DbCreateDatabase(DbConnection connection, Nullable`1 commandTimeout, StoreItemCollection storeItemCollection)
       at System.Data.Entity.Core.Common.DbProviderServices.CreateDatabase(DbConnection connection, Nullable`1 commandTimeout, StoreItemCollection storeItemCollection)
       at System.Data.Entity.Core.Objects.ObjectContext.CreateDatabase()
       at Effort.EntityConnectionFactory.CreateEntityConnection(MetadataWorkspace metadata, DbConnection connection)
       at Effort.EntityConnectionFactory.CreateTransient(String entityConnectionString, IDataLoader dataLoader)
       at Effort.EntityConnectionFactory.CreateTransient(String entityConnectionString)
       at test_kt_db.TestJobs.init() in e:\dev\aardvark_stuff\kt_db\trunk\test_kt_db\TestJobs.cs:line 28
  InnerException: 
There's nothing all that unusual about the table in question:
create table rawticket
(
    constraint rawticketPrimaryKey
    primary key
    (
        customerid,
        jobid,
        occid,
        seqno,
        sendto,
        xmitdtdate,
        xmitdttime,
        receivedtdate,
        receivedttime,
        linenum
    ),
    customerid char(32),
    jobid char(16),
    occid char(8),
    seqno smallint,
    sendto char(16),
    xmitdtdate datetime,
    xmitdttime char(12),
    receivedtdate datetime,
    receivedttime char(12),
    linenum smallint,
    contents char(255)
);

create index rawticketReceivedtIndex on rawticket
(
    jobid,
    linenum,
    receivedtdate,
    receivedttime
);
Jul 9, 2014 at 4:03 PM
We were running beta5. Updated to 1.1 and the issue was resolved.
Coordinator
Sep 8, 2014 at 7:01 PM
Thank you for being such an active contributor! Nice see that this issue was resolved after all.