Effort Entity Framework Sequence contains not matching elements

450 Views Asked by At

So I've been trying to setup Effort and am not having much success. Looking on their site and people's comments it looks pretty straightforward.

I started small because I just wanted to test if it works. The error I get is "Sequence contains no matching element"

I've added a constructor like so to the dbcontext.

public ApplicationDbContext(DbConnection connection) 
        : base(connection, true)
    {
    }

My setup like so for my test

var connection = Effort.DbConnectionFactory.CreateTransient();
var context = new ApplicationDbContext(connection );

Just a test to see if it works

context.Set<MyType>().Add(new MyType() {Description = "test"});

Class for MyType

public class MyType
    {
        [Key]
        public byte Id { get; set; }

        [Required, MaxLength(50)]
        public string Description { get; set; }
    }

I have also tried this with the createpersistent. Same result.

I am using ef6 code first, mvc 5, .net 462.

1

There are 1 best solutions below

0
AudioBubble On

Found the problem I had another data model with a property containing the following annotation. It didn't like it. Commented it out and it worked.

[Column(TypeName = "XML")]