mysql - How to use unsigned int / long types with Entity Framework? -


with long form data types are mapped correctly when adding a new migration (Code-before), but the Ulm data types are omitted by the eF provider of mysql how a ?

mappings a property to use that entity framework unsigned Does not support data types For the uint column, any one can store the value in a signed data type with a large range (i.e., a long ) is. About ulong column? The general solution could not work for me because there is no EF-supported signature data type that can hold inverted code without any overflow.

After a little bit of thinking, I thought an easy solution to this problem: simply enter the data in the supported long type and if it is accessed then ulong Enter . You might have been thinking: "But wait, Ulong's maximum value & gt; maximum value for long!" You can still store a Ulux bytes in the long run, and then when you need it, revert it, as both of them have 8 bytes. It allows you to save a vulgar variable for a database through EF will allow.

  // Avoid modifying the following directly // Only used as a database column Public long __MyVariable {received; Set; } // Access / modify this variable. // Tell EF to not map this field to the DB table [Notepad] Public ULLL Permanent {Receive {uncheck (return) __Mearnal;}} set {uncontrolled {__MyVariable = (long) value; < / P> 

Casting has been unchecked .

Hope it helps someone to stop the overstalla exceptions.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -