Unmapped property - databinding - HowTo?

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
Nic77
Posts: 2
Joined: Thu 29 Jul 2010 13:27

Unmapped property - databinding - HowTo?

Post by Nic77 » Mon 18 Oct 2010 08:59

Hi,

I want to implement a property in an EntityClass that has no representation in a database table. E. g. have .net code place content in this column.

I tried to add a property in a partial class, but had no success when then later using this entity as binduingsource for a grid. I tried to tag the property with [DataMember] but was not successful either any helpü is appreciated.

Here is as far as I got it... The property is accessible, values in thsi property can be read and changed, but when using this Entityclass as underlying datasource for a grid, the unmapped prperty is not available.

public partial class MyEntityClass
{
private byte[] _Image;

[DataMember]
public byte[] myIMAGE
{
get { return this._Image; }
set { this._Image = value; }
}
}

Thank you


Andreas

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Mon 18 Oct 2010 13:41

This seems to be a known bug in the BindingSource implementation associated with the partial classes.
See, for example, this link.
This thread contains a workaround as well.

Post Reply