<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Value is not compatible with property</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Value is not compatible with property</description>
  <pubDate>Thu, 15 Oct 2026 13:41:00 -700</pubDate>
  <lastBuildDate>Thu, 21 Jul 2011 09:58:31 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=2046</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Value is not compatible with property : I am having the same issue as...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2046&amp;PID=11262#11262</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1215" rel="nofollow">Matt Foley</a><br /><strong>Subject:</strong> 2046<br /><strong>Posted:</strong> 21-Jul-2011 at 9:58am<br /><br />I am having the same issue as your second issue, <br><blockquote>IdGenerator problem - not all temp ids converted to permanent ids.<br>If you are using auto-incrementing ids check that the FixupTempIds SaveOption is set to InSaveListOnly.<br>This may also occur if your custom IIdGenerator was not found or its GetRealIdMap method did not<br>provide a corresponding real id for each temp id.<br></blockquote>However this occurs for me after a EntityManager.RejectChanges(); call.<br><br>I have a similar model structure in that I am creating an entity with subentities that are automatically filled with auto-generated int id's on a Create method in the entity's partial class definition.<br><br>I have tried the suggestion of specifying the FixupTempIds SaveOption to InSaveListOnly by modifying the Manager's DefaultSaveOptions (because I have no way to pass it in as a param since this is happening in RejectChanges).<br><br>Also, saving has no problems.<br>]]>
   </description>
   <pubDate>Thu, 21 Jul 2011 09:58:31 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2046&amp;PID=11262#11262</guid>
  </item> 
  <item>
   <title>Value is not compatible with property : I&amp;#039;ll send you a sample project...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2046&amp;PID=7999#7999</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=885" rel="nofollow">bennage</a><br /><strong>Subject:</strong> 2046<br /><strong>Posted:</strong> 05-Aug-2010 at 7:42am<br /><br />I'll send you a sample project for review.]]>
   </description>
   <pubDate>Thu, 05 Aug 2010 07:42:21 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2046&amp;PID=7999#7999</guid>
  </item> 
  <item>
   <title>Value is not compatible with property : A pal of mine offered some additional...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2046&amp;PID=7992#7992</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=482" rel="nofollow">WardBell</a><br /><strong>Subject:</strong> 2046<br /><strong>Posted:</strong> 05-Aug-2010 at 1:36am<br /><br />A pal of mine offered some additional thoughts: <DIV>&nbsp;</DIV><DIV><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d"><FONT size=3><FONT face=Calibri>First look at the DebugLog to see if an IdGenerator is being discovered – if not – bingo<?: prefix = o ns = "urn:schemas-microsoft-com:office:office" /><O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d"><FONT size=3><FONT face=Calibri>If so, have him send the IdGenerator that he is using., or have him debug into his IdGenerator GetRealIdMap method. <O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d"><O:P><FONT size=3 face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d"><FONT size=3><FONT face=Calibri>Or<O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d"><O:P><FONT size=3 face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d"><FONT size=3><FONT face=Calibri>He may be using autoincrement ids and only sending part of the graph – hence the hint about <O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d"><O:P><FONT size=3 face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt">&nbsp;&nbsp;&nbsp; If you are using auto-incrementing ids check that the FixupTempIds SaveOption is set to InSaveListOnly</SPAN><SPAN style="COLOR: #1f497d"><O:P></O:P></SPAN></P></DIV><DIV>&nbsp;</DIV><DIV>And how could you be "<FONT color=#1f497d size=3 face=Calibri>only sending part of the graph</FONT>"? You would be doing so if you called</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp; <FONT size=4 face="Courier New, Courier, mono">manager.SaveChanges(someEntities)</FONT>&nbsp; </DIV><DIV>&nbsp;</DIV><DIV>where "someEntities" is a subset of the entities you changed.&nbsp; </DIV><DIV>&nbsp;</DIV><DIV>I'm always wary of this overload. It's too easy to omit an entity that has changes and should have been saved with the others. The mistake can mean a data integrity problem.</DIV><DIV>&nbsp;</DIV><DIV>That overload has its place ... but one needs to be certain.</DIV><DIV>&nbsp;</DIV><DIV>You might ask "what is that 'FixupTempIds SaveOption'?".&nbsp; The DevForce "API Reference" is a good place to learn about it (that's the help file generated from our XML comments; find it from Windows Menu | All Programs | DevForce 2010 ... | Documentation).</DIV><DIV>&nbsp;</DIV><DIV>Turns out you can tune the SaveChanges behavior with a SaveOptions object. SaveOptions has several properties, one of which is FixupTempIds. Its "InSaveListOnly" enum means &nbsp;"Perform Id fixup only on those entities passed into the SaveChanges method. "</DIV><DIV>&nbsp;</DIV><DIV>Looking at the debug log is ALWAYS a good first step when you're wondering what the server did. If we ask you to send us an example of a problem, we'll want that debug log too. </DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Thu, 05 Aug 2010 01:36:21 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2046&amp;PID=7992#7992</guid>
  </item> 
  <item>
   <title>Value is not compatible with property : Something is unexpected and unexplained...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2046&amp;PID=7990#7990</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=482" rel="nofollow">WardBell</a><br /><strong>Subject:</strong> 2046<br /><strong>Posted:</strong> 05-Aug-2010 at 1:02am<br /><br /><P>Something is unexpected and unexplained about your model and your application. I cannot reproduce these behaviors using the NorthwindIB tutorial database and the usual out-of-the-box, table-per-type mapping.</P><DIV>Below is my test ... which passes. Because it passes and&nbsp;the wheels come off for you ... even if you later thought you got it to work ... suggests&nbsp;that&nbsp;you have an unusual, possibly corrupt model or that there are steps in the process that are unknown to me. The fact that you have Order.Id == 0 instead of a negative number (indicating a temporary id) indicates another missing piece to the story. I don't suppose you wrote your own custom IdGenerator ... that would be a pertinent fact.</DIV><DIV>&nbsp;</DIV><DIV>The SaveChanges misbehaviors aren't reproducable in my&nbsp;setup either ... which is unsurprising&nbsp;given that I don't have your model or code.</DIV><DIV>&nbsp;</DIV><DIV>I'll need a cutdown version of the model, the edmx,&nbsp;and your code to make&nbsp;progress. Sorry&nbsp;about that.</DIV><DIV>&nbsp;</DIV><DIV>Here's my test. Note that I never bother to talk to the database; I can test the pertinent facts without going near a database.</DIV><DIV><PRE style="FONT-FAMILY: c&#111;nsolas"><PRE style="FONT-FAMILY: c&#111;nsolas">&nbsp;&nbsp;&nbsp;&nbsp;&#091;<SPAN style="COLOR: #2b91af">TestMethod</SPAN>&#093;<BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">public</SPAN>&nbsp;<SPAN style="COLOR: blue">void</SPAN>&nbsp;can_add_lineItem_to_new_detached_order()&nbsp;{<BR> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">var</SPAN>&nbsp;mgr&nbsp;=&nbsp;<SPAN style="COLOR: blue">new</SPAN>&nbsp;<SPAN style="COLOR: #2b91af">NorthwindManager</SPAN>(<SPAN style="COLOR: blue">false <SPAN style="COLOR: green">/* = disconnected */</SPAN></SPAN>);<BR> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: green">//&nbsp;Pretend&nbsp;we&nbsp;retrieved&nbsp;an existing&nbsp;product</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">var</SPAN>&nbsp;prod&nbsp;=&nbsp;<SPAN style="COLOR: blue">new</SPAN>&nbsp;<SPAN style="COLOR: #2b91af">Product</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ProductID&nbsp;=&nbsp;42,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ProductName&nbsp;=&nbsp;<SPAN style="COLOR: #a31515">"Foo"</SPAN>,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mgr.AttachEntity(prod);&nbsp;<SPAN style="COLOR: green">//&nbsp;attaches&nbsp;as&nbsp;"unchanged"</SPAN><BR> <BR></PRE><PRE style="FONT-FAMILY: c&#111;nsolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">var</SPAN>&nbsp;order&nbsp;=&nbsp;<SPAN style="COLOR: blue">new</SPAN>&nbsp;<SPAN style="COLOR: #2b91af">Order</SPAN>();&nbsp;<SPAN style="COLOR: green">//&nbsp;not&nbsp;yet associated&nbsp;with&nbsp;a manager</SPAN> </PRE><PRE style="FONT-FAMILY: c&#111;nsolas"><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: green">//&nbsp;Create&nbsp;new&nbsp;lineitem&nbsp;which&nbsp;is&nbsp;immediately&nbsp;added&nbsp;to&nbsp;mgr</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: green">//&nbsp;because&nbsp;the&nbsp;assignment&nbsp;of&nbsp;its&nbsp;Product&nbsp;pulls&nbsp;it&nbsp;into</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: green">//&nbsp;the&nbsp;mgr&nbsp;of&nbsp;the&nbsp;"Prod"&nbsp;entity.</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: green">//&nbsp;The&nbsp;act&nbsp;of&nbsp;adding&nbsp;this&nbsp;lineitem&nbsp;to&nbsp;the&nbsp;lineitems&nbsp;of&nbsp;the&nbsp;order</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: green">//&nbsp;causes&nbsp;the&nbsp;new&nbsp;order&nbsp;to&nbsp;be&nbsp;pulled&nbsp;into&nbsp;the&nbsp;mgr as well.</SPAN></PRE><PRE style="FONT-FAMILY: c&#111;nsolas"><SPAN style="COLOR: green">      </SPAN><SPAN style="COLOR: green">// All this confirmed in subsequent Asserts.</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;order.OrderDetails.Add(<SPAN style="COLOR: blue">new</SPAN>&nbsp;<SPAN style="COLOR: #2b91af">OrderDetail</SPAN>{Product&nbsp;=&nbsp;prod}); </PRE><PRE style="FONT-FAMILY: c&#111;nsolas"><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #2b91af">Assert</SPAN>.AreEqual(order.EntityAspect.EntityState,&nbsp;<SPAN style="COLOR: #2b91af">EntityState</SPAN>.Added);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #2b91af">Assert</SPAN>.AreEqual(1,&nbsp;order.OrderDetails.Count); </PRE><PRE style="FONT-FAMILY: c&#111;nsolas"><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">var</SPAN>&nbsp;lineItem&nbsp;=&nbsp;order.OrderDetails.First();&nbsp;<SPAN style="COLOR: green">//&nbsp;get&nbsp;the&nbsp;new&nbsp;OrderDetail</SPAN><BR></PRE><PRE style="FONT-FAMILY: c&#111;nsolas"> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #2b91af">Assert</SPAN>.AreEqual(lineItem.EntityAspect.EntityState,&nbsp;<SPAN style="COLOR: #2b91af">EntityState</SPAN>.Added);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #2b91af">Assert</SPAN>.AreSame(lineItem.Product,&nbsp;prod);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #2b91af">Assert</SPAN>.AreSame(order.EntityAspect.EntityManager,&nbsp;lineItem.EntityAspect.EntityManager);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #2b91af">Assert</SPAN>.AreSame(order.EntityAspect.EntityManager,&nbsp;prod.EntityAspect.EntityManager);<BR> <BR>&nbsp;&nbsp;&nbsp;&nbsp;}</PRE></PRE></DIV><span style="font-size:10px"><br /><br />Edited by WardBell - 05-Aug-2010 at 1:05am</span>]]>
   </description>
   <pubDate>Thu, 05 Aug 2010 01:02:39 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2046&amp;PID=7990#7990</guid>
  </item> 
  <item>
   <title>Value is not compatible with property : The LineItem is assigned an id...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2046&amp;PID=7982#7982</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=885" rel="nofollow">bennage</a><br /><strong>Subject:</strong> 2046<br /><strong>Posted:</strong> 04-Aug-2010 at 12:43pm<br /><br />The LineItem is assigned an id (usually 33), I'm not certain where this id comes from.]]>
   </description>
   <pubDate>Wed, 04 Aug 2010 12:43:57 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2046&amp;PID=7982#7982</guid>
  </item> 
  <item>
   <title>Value is not compatible with property : Ok, here&amp;#039;s my new exception...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2046&amp;PID=7981#7981</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=885" rel="nofollow">bennage</a><br /><strong>Subject:</strong> 2046<br /><strong>Posted:</strong> 04-Aug-2010 at 12:41pm<br /><br />Ok, here's my new exception (though perhaps this should be a new post).<br /><br />When I call SaveChanges() on the manager after adding the LineItem. I get this exception:<br /><br />IdGenerator problem - not all temp ids converted to permanent ids.<br />If you are using auto-incrementing ids check that the FixupTempIds SaveOption is set to InSaveListOnly.<br />This may also occur if your custom IIdGenerator was not found or its GetRealIdMap method did not<br />provide a corresponding real id for each temp id.]]>
   </description>
   <pubDate>Wed, 04 Aug 2010 12:41:29 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2046&amp;PID=7981#7981</guid>
  </item> 
  <item>
   <title>Value is not compatible with property : It turns out the &amp;#034;Value is...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2046&amp;PID=7980#7980</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=885" rel="nofollow">bennage</a><br /><strong>Subject:</strong> 2046<br /><strong>Posted:</strong> 04-Aug-2010 at 12:18pm<br /><br />It turns out the "Value is not compatible with property" was something of a red herring.<br />My problem was that I was trying to load an Order that didn't exist (id = 0). When I corrected this (so that I was actually loading a real order) this particular error when away.<br />I'm now experiencing another exception. I'll report back once it is fixed.]]>
   </description>
   <pubDate>Wed, 04 Aug 2010 12:18:21 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2046&amp;PID=7980#7980</guid>
  </item> 
  <item>
   <title>Value is not compatible with property : Hi Christoper -  Hmm ... that...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2046&amp;PID=7979#7979</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=482" rel="nofollow">WardBell</a><br /><strong>Subject:</strong> 2046<br /><strong>Posted:</strong> 04-Aug-2010 at 11:47am<br /><br />Hi Christoper -<DIV>&nbsp;</DIV><DIV>Hmm ... that sure is raw</DIV><DIV>&nbsp;</DIV><DIV><FONT size=4 face="Courier New, Courier, mono">&nbsp; order.LineItems.Add( new LineItem() { Product = product }; </FONT><BR></DIV><DIV>I'm sure this is demo code :-)</DIV><DIV>&nbsp;</DIV><DIV>I don't know the answer because I don't have the code. But 'm going to interpret the call stack with you and see if that is suggestive.</DIV><DIV>&nbsp;</DIV><DIV>It seems&nbsp;you survived the creation of the LineItem and the assignment of its Product.</DIV><DIV>&nbsp;</DIV><DIV>DevForce&nbsp;is in the process of adding the line item to the list. Having realized the direction of the relationship, it knows it must update the Order FK value of the LineItem</DIV><DIV>&nbsp;</DIV><DIV><FONT face="Courier New, Courier, mono">&nbsp; ...AddInverse(T otherEntity) </FONT></DIV><DIV><FONT face="Courier New, Courier, mono">&nbsp; ...SetEntity(T newValue, Boolean updateFkValues, Boolean updateInverseValues)</FONT></DIV><DIV><BR>Now it must ensure that the Order FK property type (LineItem.OrderId ?) is compatible with the type of the Order' primary key type (Order.Id).</DIV><DIV>&nbsp;</DIV><DIV><FONT face="Courier New, Courier, mono">&nbsp; ...CheckPropertyValueCompatibility(DataEntityProperty property, Object newValue)</FONT></DIV><DIV>&nbsp;</DIV><DIV>And apparently the two property types are "incompatible"</DIV><DIV>&nbsp;</DIV><DIV><FONT face="Courier New, Courier, mono">&nbsp;&nbsp; Value is not compatible with property: Id DataType: System.Int32 </FONT></DIV><DIV>&nbsp;</DIV><DIV>This makes me wonder if the Order.Id and LineItem.OrderId are both Int32. Maybe they are both integer types but not both Int32. Of course then I'd have to wonder (a) how you got this far without DevForce objecting earlier and (b) why we don't coerce if we can. But let's see what you find out first.</DIV>]]>
   </description>
   <pubDate>Wed, 04 Aug 2010 11:47:26 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2046&amp;PID=7979#7979</guid>
  </item> 
  <item>
   <title>Value is not compatible with property : I should add, this is 6.0.4, in...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2046&amp;PID=7976#7976</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=885" rel="nofollow">bennage</a><br /><strong>Subject:</strong> 2046<br /><strong>Posted:</strong> 04-Aug-2010 at 10:41am<br /><br />I should add, this is 6.0.4, in the context of an ASP.NET MVC application.]]>
   </description>
   <pubDate>Wed, 04 Aug 2010 10:41:05 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2046&amp;PID=7976#7976</guid>
  </item> 
  <item>
   <title>Value is not compatible with property : I have 3 entities of interest....</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2046&amp;PID=7975#7975</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=885" rel="nofollow">bennage</a><br /><strong>Subject:</strong> 2046<br /><strong>Posted:</strong> 04-Aug-2010 at 9:00am<br /><br />I have 3 entities of interest. Something like this:<br />Order<br />LineItem<br />Product<br /><br />Order can have many LineItems, a LineItem can have a single Product.<br />Everything has integer ids.<br /><br />I retrieve an instance of an existing Order.<br />I create a new LineItem and associate it with an existing Product.<br />I then add the new LineItem to a collection of LineItems on the Order instance. I get the exception below.<br />The exception occurs as a add the LineItem. For example, on:<br />  order.LineItems.Add( new LineItem() { Product = product };<br /><br />Prior to adding , the LineItem has an id of -100 (or -101 or something similar).<br /><br />Value is not compatible with property: Id DataType: System.Int32 <br />&nbsp;&nbsp;&nbsp;at IdeaBlade.EntityModel.EntityWrapper.CheckPropertyValueCompatibility(DataEntityProperty property, Object newValue)<br />&nbsp;&nbsp;&nbsp;at IdeaBlade.EntityModel.EntityWrapper.SetValueWithChangeNotification(DataEntityProperty property, Object newValue)<br />&nbsp;&nbsp;&nbsp;at IdeaBlade.EntityModel.EntityWrapper.SetValue(DataEntityProperty targetProperty, EntityWrapper sourceEntity, DataEntityProperty sourceProperty)<br />&nbsp;&nbsp;&nbsp;at IdeaBlade.EntityModel.ScalarEntityReference`1.UpdateOtherProperties(EntityRelationLink relationLink, EntityWrapper fromEntity, EntityWrapper toEntity)<br />&nbsp;&nbsp;&nbsp;at IdeaBlade.EntityModel.ScalarEntityReference`1.UpdateFkForNewToEntity(EntityWrapper toEntity)<br />&nbsp;&nbsp;&nbsp;at IdeaBlade.EntityModel.ScalarEntityReference`1.SetEntity(T newValue, Boolean updateFkValues, Boolean updateInverseValues)<br />&nbsp;&nbsp;&nbsp;at IdeaBlade.EntityModel.ScalarEntityReference`1.AddEntity(Object entity, Boolean updateInverseValues)<br />&nbsp;&nbsp;&nbsp;at IdeaBlade.EntityModel.RelatedEntityList`1.AddInverse(T otherEntity)<br />&nbsp;&nbsp;&nbsp;at IdeaBlade.EntityModel.RelatedEntityList`1.AddOrInsert(Int32 index, T item, Boolean updateInverse)<br />&nbsp;&nbsp;&nbsp;at IdeaBlade.EntityModel.RelatedEntityList`1.Add(T item)<br />&nbsp;&nbsp;&nbsp;at MSU.CollegeOfMusic.MVC.Controllers.AdmissionApplicationController.AddInstitution(InstitutionOfInterestViewModel vm, Int32 applicationId) in E:\projects\msu\src\MSU.CollegeOfMusic.MVC\Controllers\AdmissionApplicationController.cs:line 75<br />&nbsp;&nbsp;&nbsp;at lambda_method(Closure , ControllerBase , Object&#091;&#093; )<br />&nbsp;&nbsp;&nbsp;at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object&#091;&#093; parameters)<br />&nbsp;&nbsp;&nbsp;at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)<br />&nbsp;&nbsp;&nbsp;at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)<br />&nbsp;&nbsp;&nbsp;at System.Web.Mvc.ControllerActionInvoker.&lt;&gt;c__DisplayClassd.&lt;InvokeActionMethodWithFilters&gt;b__a()<br />&nbsp;&nbsp;&nbsp;at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)]]>
   </description>
   <pubDate>Wed, 04 Aug 2010 09:00:41 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2046&amp;PID=7975#7975</guid>
  </item> 
 </channel>
</rss>