Sequence contains no matching element - EntityFramework

c# ef-code-first entity-framework wcf wcf-data-services

Question

In order to create a WCF Service, I was using EF 6.1.0.

In order to initialize EF, I first constructed a Class Library including my entities, Mappers, and Context. Additionally, I developed a class with the following code that contains an instance of the context:

public IQueryable<[Entity]> GetAll()
{
    return context.[Entity].AsQueryable();
}

On the other hand, I've developed a WCF Service on the same project that uses the GetAll() function in the.svc file as follows:

public List<[Entity]> GetList()
{
    [iObject] repository = new [Object](new Context());
    return repository.GetAll().ToList();
}

A project is being developed. I have even verified that the setting is in the correct database. However, the generated database and tables don't exist, and the error message "Sequence contains no matching element" appears in the output.

If this one is unclear, please direct my attention to a link that uses the Code First Entity Framework for WCF Services.

1
22
4/10/2014 8:38:45 AM

Popular Answer

Due to a problem, I experiencedSystem.InvalidOperationException including the messageSequence contains no matching element because I was passing an erroneous string value to.HasColumnType() in the arrangement of my table.

62
10/2/2014 8:15:36 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow