create my own property with the Entity Developer

create my own property with the Entity Developer

Postby Marcus » Fri 15 May 2009 09:50

Hi,

how can i create my own property with the Entity Developer and LinqToSql which is
not binding on a table column.?

I added my own property with the Entity Developer with empty [Source] and [Server Data Type] because the property is not binded on a table column.

When i start my progam i become an exception ("invalid datatype").

I remove the Column attribute of my property and it works but when i open the Entity Developer than he added the Column attribute to my property again. ;(

I need my own property for this issue:
-> when the [price] or [quantity] changed
...then i calculate the [LinePrice] (own Property).

Can everyone help me?

Thanks & Ciao,
Marcus
Marcus
 
Posts: 7
Joined: Fri 20 Mar 2009 08:42

Postby AndreyR » Fri 15 May 2009 11:29

I recommend you to put this property into the extension class (DataContext1.cs, not DataContext1.Designer.cs), like in the following example:
Code: Select all
// This file is intended to be edited manually

namespace WindowsFormsApplication5 {
  partial class DataContext1 {

    // Place your implementation of partial extension methods here
  }
  public partial class dept {
    public System.String Property1 {
      get {
        return "Hello";
      }
    }
  }
}
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Postby Marcus » Fri 15 May 2009 13:09

Thank you for the solution!

Have a nice weekend
Marcus
 
Posts: 7
Joined: Fri 20 Mar 2009 08:42


Return to LinqConnect (LINQ to SQL support)