<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="http://www.codeplex.com/rss.xsl"?><rss version="2.0"><channel><title>MultiTierLinqToSql Issue Tracker Rss Feed</title><link>http://www.codeplex.com/MultiTierLinqToSql/WorkItem/List.aspx</link><description>MultiTierLinqToSql Issue Tracker Rss Description</description><item><title>Closed Issue: Bugs in PrimaryKeyName and UpdateOriginalFromChanged [4680]</title><link>http://multitierlinqtosql.codeplex.com/WorkItem/View.aspx?WorkItemId=4680</link><description>I&amp;#39;ve just tried updating a project to use version 2.0, and come across a couple of major problems with some of my existing code that uses the GetEntity and UpdateOriginalFromChanged.&lt;br /&gt;&lt;br /&gt;In order to make the minimum of changes I have replaced the previous inheritance from GenericController with inheritance from StaticGenericRepository, however when I&amp;#39;m calling GetEntity, this is throwing a null reference exception. This looks to be being caused by the Get method for the PrimaryKeyName property which is returning primaryKey.MappedName at line 156 which is then used to try and find the primary key property - using primaryKey.Name instead allows this to work.&lt;br /&gt;&lt;br /&gt;There is a similar problem in UpdateOriginalFromChanged, where the DatabaseProperties method is again using dm.MappedName at line 199.&lt;br /&gt;&lt;br /&gt;Both of these bugs would only be apparent when using DBML that renames some of the columns - MappedName is the name of the underlying database field, which in our case is different from the property names in the LINQ data model.&lt;br /&gt;Comments: &lt;p&gt;&lt;/p&gt;</description><author>taliesins</author><pubDate>Wed, 30 Sep 2009 10:30:13 GMT</pubDate><guid isPermaLink="false">Closed Issue: Bugs in PrimaryKeyName and UpdateOriginalFromChanged [4680] 20090930103013A</guid></item><item><title>Commented Issue: Bugs in PrimaryKeyName and UpdateOriginalFromChanged [4680]</title><link>http://multitierlinqtosql.codeplex.com/WorkItem/View.aspx?WorkItemId=4680</link><description>I&amp;#39;ve just tried updating a project to use version 2.0, and come across a couple of major problems with some of my existing code that uses the GetEntity and UpdateOriginalFromChanged.&lt;br /&gt;&lt;br /&gt;In order to make the minimum of changes I have replaced the previous inheritance from GenericController with inheritance from StaticGenericRepository, however when I&amp;#39;m calling GetEntity, this is throwing a null reference exception. This looks to be being caused by the Get method for the PrimaryKeyName property which is returning primaryKey.MappedName at line 156 which is then used to try and find the primary key property - using primaryKey.Name instead allows this to work.&lt;br /&gt;&lt;br /&gt;There is a similar problem in UpdateOriginalFromChanged, where the DatabaseProperties method is again using dm.MappedName at line 199.&lt;br /&gt;&lt;br /&gt;Both of these bugs would only be apparent when using DBML that renames some of the columns - MappedName is the name of the underlying database field, which in our case is different from the property names in the LINQ data model.&lt;br /&gt;Comments: ** Comment from web user: taliesins ** &lt;p&gt;Yes you are totally correct. Thanks for catching this bug. It will be updated in future versions&lt;/p&gt;</description><author>taliesins</author><pubDate>Wed, 30 Sep 2009 09:55:51 GMT</pubDate><guid isPermaLink="false">Commented Issue: Bugs in PrimaryKeyName and UpdateOriginalFromChanged [4680] 20090930095551A</guid></item><item><title>Commented Issue: Bug in GenericController.GetEntity(object id) when using a Guid [3781]</title><link>http://multitierlinqtosql.codeplex.com/WorkItem/View.aspx?WorkItemId=3781</link><description>First of all, great work with this library&amp;#33; I&amp;#39;m building a website using Linq To Sql and this library has been a lifesaver when dealing with the DataContext issues.&lt;br /&gt;&lt;br /&gt;The GetEntity method will throw a SqlException because the Guid value is not quoted in the select query. I found a solution around the error, but i&amp;#39;m not 100&amp;#37; sure if this will work in all situations &amp;#40;Currently it&amp;#39;s only tested having a Guid as primary key&amp;#41;.&lt;br /&gt;&lt;br /&gt;I replaced the body of the GetEntity method with&amp;#58;&lt;br /&gt;&lt;br /&gt;ParameterExpression paramExpr &amp;#61; Expression.Parameter&amp;#40;typeof&amp;#40;TEntity&amp;#41;, &amp;#34;e&amp;#34;&amp;#41;&amp;#59;&lt;br /&gt;Expression&amp;#60;Func&amp;#60;TEntity, bool&amp;#62;&amp;#62; predicate &amp;#61; Expression.Lambda&amp;#60;Func&amp;#60;TEntity, bool&amp;#62;&amp;#62;&amp;#40;Expression.Equal&amp;#40;Expression.Property&amp;#40;paramExpr, PrimaryKeyDBColumnName&amp;#41;, Expression.Constant&amp;#40;id&amp;#41;&amp;#41;, paramExpr&amp;#41;&amp;#59;&lt;br /&gt;return EntityTable.FirstOrDefault&amp;#40;predicate&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;Any feedback on this solution is greatly appreciated&lt;br /&gt;Comments: ** Comment from web user: taliesins ** &lt;p&gt;I suspect that the problem lies in the following line.&lt;/p&gt;&lt;p&gt;Change&amp;#58;&lt;br /&gt;ConstantExpression value &amp;#61; Expression.Constant&amp;#40;Convert.ChangeType&amp;#40;id, primaryKey.Type&amp;#41;&amp;#41;&amp;#59;&lt;/p&gt;&lt;p&gt;To&amp;#58;&lt;br /&gt;ConstantExpression value &amp;#61; Expression.Constant&amp;#40;Convert.ChangeType&amp;#40;id, primaryKey.Type&amp;#41;, primaryKey.Type&amp;#41;&amp;#59;&lt;/p&gt;</description><author>taliesins</author><pubDate>Wed, 30 Sep 2009 09:22:17 GMT</pubDate><guid isPermaLink="false">Commented Issue: Bug in GenericController.GetEntity(object id) when using a Guid [3781] 20090930092217A</guid></item><item><title>Created Issue: Bugs in PrimaryKeyName and UpdateOriginalFromChanged</title><link>http://multitierlinqtosql.codeplex.com/WorkItem/View.aspx?WorkItemId=4680</link><description>I&amp;#39;ve just tried updating a project to use version 2.0, and come across a couple of major problems with some of my existing code that uses the GetEntity and UpdateOriginalFromChanged.&lt;br /&gt;&lt;br /&gt;In order to make the minimum of changes I have replaced the previous inheritance from GenericController with inheritance from StaticGenericRepository, however when I&amp;#39;m calling GetEntity, this is throwing a null reference exception. This looks to be being caused by the Get method for the PrimaryKeyName property which is returning primaryKey.MappedName at line 156 which is then used to try and find the primary key property - using primaryKey.Name instead allows this to work.&lt;br /&gt;&lt;br /&gt;There is a similar problem in UpdateOriginalFromChanged, where the DatabaseProperties method is again using dm.MappedName at line 199.&lt;br /&gt;&lt;br /&gt;Both of these bugs would only be apparent when using DBML that renames some of the columns - MappedName is the name of the underlying database field, which in our case is different from the property names in the LINQ data model.&lt;br /&gt;</description><author>RTPeat</author><pubDate>Fri, 03 Jul 2009 15:26:52 GMT</pubDate><guid isPermaLink="false">Created Issue: Bugs in PrimaryKeyName and UpdateOriginalFromChanged 20090703032652P</guid></item><item><title>Created Issue: Bug in GenericController.GetEntity(object id) when using a Guid</title><link>http://www.codeplex.com/MultiTierLinqToSql/WorkItem/View.aspx?WorkItemId=3781</link><description>First of all, great work with this library&amp;#33; I&amp;#39;m building a website using Linq To Sql and this library has been a lifesaver when dealing with the DataContext issues.&lt;br /&gt;&lt;br /&gt;The GetEntity method will throw a SqlException because the Guid value is not quoted in the select query. I found a solution around the error, but i&amp;#39;m not 100&amp;#37; sure if this will work in all situations &amp;#40;Currently it&amp;#39;s only tested having a Guid as primary key&amp;#41;.&lt;br /&gt;&lt;br /&gt;I replaced the body of the GetEntity method with&amp;#58;&lt;br /&gt;&lt;br /&gt;ParameterExpression paramExpr &amp;#61; Expression.Parameter&amp;#40;typeof&amp;#40;TEntity&amp;#41;, &amp;#34;e&amp;#34;&amp;#41;&amp;#59;&lt;br /&gt;Expression&amp;#60;Func&amp;#60;TEntity, bool&amp;#62;&amp;#62; predicate &amp;#61; Expression.Lambda&amp;#60;Func&amp;#60;TEntity, bool&amp;#62;&amp;#62;&amp;#40;Expression.Equal&amp;#40;Expression.Property&amp;#40;paramExpr, PrimaryKeyDBColumnName&amp;#41;, Expression.Constant&amp;#40;id&amp;#41;&amp;#41;, paramExpr&amp;#41;&amp;#59;&lt;br /&gt;return EntityTable.FirstOrDefault&amp;#40;predicate&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;Any feedback on this solution is greatly appreciated&lt;br /&gt;</description><author>vl_itchie</author><pubDate>Wed, 11 Feb 2009 15:16:49 GMT</pubDate><guid isPermaLink="false">Created Issue: Bug in GenericController.GetEntity(object id) when using a Guid 20090211031649P</guid></item></channel></rss>