This is a migrated thread and some comments may be shown as answers.

MetadataException Pls Help

1 Answer 37 Views
Web Services
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Cuneyt
Top achievements
Rank 1
Cuneyt asked on 02 Sep 2013, 09:15 AM
I dont have any idea about exception. Pls help.
I have table with sqltype geography. and i create a web api service with openacess wizard from this table. but if i try to use web service application give me this error.
İ need help.

Error text:
MetadataException was unhandled by user code
No database type mapping found for the field '<value>': CLR type 'Application.OpenAccess.Traffic' or column type " unmapped.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Dimitar Tachev
Telerik team
answered on 05 Sep 2013, 08:58 AM
Hello Cuneyt,

 
In order to use the Geography data from your tables properly I suggest you follow the steps described in our How to: Work with Special Data documentation section.

You could find an example of our Special Data support at the Basic Special Data with OpenAccess ORM example in the WPF section of our Sample Kit. Also you could take a look at this blog post demonstrating how to integrate an OpenAccess ORM model containing Special Data with the WPF RadMap.

Please bear in mind that if you don't include your Geometry property in the fetch strategy of the context instance of the repository for your Special Data tables, you will get a Null value after detaching the entities.
For example if you need to get the Geometry property of the Location entity from our Basic Special Data with OpenAccess ORM example using Web API service you will need to add the following code in its repository - please find an example result of the service call in the attached image:

public partial class LocationRepository :
OpenAccessBaseRepository<Location, TestDBEntityDiagrams>
{
    public override IQueryable<Location> GetAll()
    {
        this.fetchStrategy.LoadWith<Location>(l => l.GeoLocation);
 
        return base.GetAll();
    }
}

If you still experience the same issues after applying these steps, could you please provide us with more details about the steps for reproducing this issue. Also a sample application demonstrating the problematic behavior will be highly appreciated.

I am looking forward to your feedback.

Regards,
Dimitar Tachev
Telerik
OpenAccess ORM Q2 2013 brings you a more powerful code generation and a unique Bulk Operations support with LINQ syntax. Check out the list of new functionality and improvements shipped with this release.
Tags
Web Services
Asked by
Cuneyt
Top achievements
Rank 1
Answers by
Dimitar Tachev
Telerik team
Share this question
or