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 3287150
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:27:39+00:00 2026-05-17T20:27:39+00:00

by default Entity Framework maps tinyint to byte. i tried changing the underlying type

  • 0

by default Entity Framework maps tinyint to byte.

i tried changing the underlying type after it was generated to Boolean, but getting compilation error

Member Mapping specified is not valid. The type ‘Edm.Boolean[Nullable=False,DefaultValue=]’ of member blah…

is this possible in 4.0?

it wasn’t my idea to use tinyint column as boolean. this was done automatically by another team using hibernate which apparently does it that way for mysql compatibility. obviously tinyint has more values than 2. I am looking for a way to map it so that anyting accept for 1 is false, or anything accept for 0 is true. either would work for me

is there a way to plug in a type translator of sorts into EF?

  • 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-17T20:27:39+00:00Added an answer on May 17, 2026 at 8:27 pm

    From MSDN’s page on integer types, we see that the tinyint type represents an integer ranging from 0 to 255.

    A bool, in contrast, represents only a binary 0 or 1.

    Changing the default mapping from byte to bool (if it were even possible, which according to this page it seems like it’s not) does not make sense — how, for example, would you represent the value 42 (a valid tinyint) as a bool?

    If you need an entity with a property of type bool, I’d suggest mapping it to a column of type bit.

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

Sidebar

Related Questions

I am using Entity Framework with the Self-Tracking Entity T4 templates, which by default
Using the Entity Framework that I generated. I have a Roles table created during
I am using the Entity Framework to update my database. The Employee table has
I have been looking into Code First with Entity Framework CTP4 and you can
My WPF desktop-based application uses ADO.Net Entity Framework in order to connect to SQL
I am working with a large Entity Framework 4.0 edmx, and need to automate
If i have the following entity: public class PocoWithDates { public string PocoName {
i need to keep my project flexible to customer specific requirements and need your
I have a situation when some clients see the server by its local IP

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.