Print Page | Close Window

Support for abstract models

Printed From: IdeaBlade
Category: Breeze
Forum Name: Community Forum
Forum Discription: Build rich JavaScript apps using techniques you already know
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3710
Printed Date: 27-Apr-2025 at 4:19am


Topic: Support for abstract models
Posted By: Tomasz Paprocki
Subject: Support for abstract models
Date Posted: 11-Oct-2012 at 9:26am
Hi,

I have an issue with Breeze while using some EF abstract classes - there's an exception while parsing metadata on client side. Here's a simple model example that recreates this issue:

public abstract class Item
{
    [Key]
    public int Id { get; set; }

    public string Foo { get; set; }
}

public class SpecificItem : Item
{
    public int Bar { get; set; }
}

Problem starts while Breeze is trying to use undefined 'key' property for SpecificItem type in convertFromODataEntityType function (line 1251: var keyNamesOnServer = toArray(odataEntityType.key.propertyRef).map(core.pluck("name"));). Not only odataEntityType param lacks information about 'key' but also there is no information about other properties from base class (Item in this scenario).

Is there any support planned for abstract models in future? Also... Can we get any hint how to handle such scenarios atm? -  we want to keep our model the way it is now, so even some ugly, temporary workaround for Breeze would be great!

Keep up the good work! ;)

~ Tomasz



Replies:
Posted By: jtraband
Date Posted: 11-Oct-2012 at 11:22am
We do have plans to implement support for abstract types but just haven't gotten to it yet.  No easy workarounds just yet. 

Please vote for this feature request using the feedback mechanism on the web site. ( small icon on the right side of any Breeze website page labeled "Feedback").  This helps us decide which features to focus on next.  This topic has already been added there.



Print Page | Close Window