Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6888441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:00:58+00:00 2026-05-27T06:00:58+00:00

I am using WCF Data Services (OData) to expose some data that is a

  • 0

I am using WCF Data Services (OData) to expose some data that is a varchar(10) in my SQL Server Database. (I am using entity framework to expose it.)

Is there a way to ask the OData endpoint how long a string can be (ie get the 10 from varchar(10))?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:00:59+00:00Added an answer on May 27, 2026 at 6:00 am

    If the service is an EF based service, and your CSDL for the EF model contains the max string length attribute on the property, then the $metadata of the service will contain that attribute as well. The client can then parse the $metadata and ask for this.
    Note that the WCF DS Client library doesn’t have an API to do this though. You could use ODataLib and EdmLib to read the $metadata (or just plain XML). They are in Microsoft.Data.OData.dll and Microsoft.Data.Edm.dll in the latest CTP (http://blogs.msdn.com/b/astoriateam/archive/2011/10/13/announcing-wcf-data-services-oct-2011-ctp-for-net-4-and-silverlight-4.aspx).
    Note though, that if the service is based on something else than EF, then it’s currently not possible to customize the $metadata endpoint in WCF DS itself this way. You would have to expose the $metadata yourself in some other way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created an OData endpoint (using entity framework, WCF data service) and added a
I'm having a problem using WCF Data Services for an entity that has a
I have an OData Service setup using WCF Data Services (v2) that is hosted
I am using a data contract in WCF, but there is some unwanted response
I want to expose legacy .net code via WCF Data Services. But without using
I'm using WCF Data services. The default feed property for an entity in my
I understood that WCF Data Services is based on OData model (of course, REST).
Using WCF Data Services I am using a data model that contains entities with
I am using WCF Data Services over an ADO.NET Entity Data Model, and I
I have an OData WCF ADO.NET service created with Entity Framework using protocol version

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.