Linq with Null values
Linq with Null values
Hello
I was wondering if support for nullable fields will be added.
For example, I have a field in the MySQL database of Decimal type. This type can be null. The shema modeller reflects this but the code generated does not.
I noticed a new version of Linq has been provided but have not been able to upgrade yet. So sorry if this fix has already been implemented.
Thanks
AFrieze
I was wondering if support for nullable fields will be added.
For example, I have a field in the MySQL database of Decimal type. This type can be null. The shema modeller reflects this but the code generated does not.
I noticed a new version of Linq has been provided but have not been able to upgrade yet. So sorry if this fix has already been implemented.
Thanks
AFrieze
There is a problem with foreignkey values set to null.
Example:
Position entity has properties:
Id (primary key)
Name (string)
FinancialId (integer, foreign key, association with table Financial, allows null)
Above code throws InvalidCastException in code auto-generated by EntityDeveloper:
No mater what property of Position entity is changed. If any of foreign keys (in above example FinancialId) has null value - this exception is thrown.
Probably there is something with patched template.
Thank you,
Aleksander
Example:
Position entity has properties:
Id (primary key)
Name (string)
FinancialId (integer, foreign key, association with table Financial, allows null)
Code: Select all
var position = (from p in db.Position where p.Id == 6 select p).Single();
position.Name = "new name";
db.SubmitChanges();
Code: Select all
[Association(Name="Financial_Position", Storage="_Financial", ThisKey="FinancialId", IsForeignKey=true)]
public Financial Financial
{
get
{
return this._Financial.Entity; //exception occurs here!!!
}
Probably there is something with patched template.
Thank you,
Aleksander
Update for above problem.
After changing all foreign keys to not null values, above code throws identical exception in identical place.
Identical code but for Sql Server LINQ to SQL is executing without problems.
Thx, A.
Code: Select all
var position = (from p in db.Position where p.Id == 6 select p).Single();
position.Name = "new name";
position.FinancialId = 4;
db.SubmitChanges();
Identical code but for Sql Server LINQ to SQL is executing without problems.
Thx, A.
inserting null values Oracle
Hi,
Do you have a workaround so that I can insert null values when using oracle?
Thanks
Do you have a workaround so that I can insert null values when using oracle?
Thanks