<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Mapping From IDataReader/IDataRecord with AutoMapper</title>
	<atom:link href="http://elegantcode.com/2009/10/16/mapping-from-idatareaderidatarecord-with-automapper/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com/2009/10/16/mapping-from-idatareaderidatarecord-with-automapper/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mapping-from-idatareaderidatarecord-with-automapper</link>
	<description></description>
	<lastBuildDate>Sun, 12 Feb 2012 18:54:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
	<item>
		<title>By: Emdadgar2</title>
		<link>http://elegantcode.com/2009/10/16/mapping-from-idatareaderidatarecord-with-automapper/comment-page-1/#comment-64206</link>
		<dc:creator>Emdadgar2</dc:creator>
		<pubDate>Sun, 21 Aug 2011 19:20:00 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/10/16/mapping-from-idatareaderidatarecord-with-automapper/#comment-64206</guid>
		<description>Great!!! Very good class for using in small projects!!!
Thanks</description>
		<content:encoded><![CDATA[<p>Great!!! Very good class for using in small projects!!!<br />
Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://elegantcode.com/2009/10/16/mapping-from-idatareaderidatarecord-with-automapper/comment-page-1/#comment-50846</link>
		<dc:creator>David</dc:creator>
		<pubDate>Tue, 01 Dec 2009 15:50:57 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/10/16/mapping-from-idatareaderidatarecord-with-automapper/#comment-50846</guid>
		<description>When I map IDataReader to IEnumerable, it fails with null reference exception in DataReaderMapper.cs at line 106 inside the following methid:

private static void MapPropertyValues(ResolutionContext context, IMappingEngineRunner mapper, object result)
{
     // this is where it is failing... right at the first line
     foreach (var propertyMap in context.TypeMap.GetPropertyMaps())
     {
          MapPropertyValue(context, mapper, result, propertyMap);
     }
}</description>
		<content:encoded><![CDATA[<p>When I map IDataReader to IEnumerable, it fails with null reference exception in DataReaderMapper.cs at line 106 inside the following methid:</p>
<p>private static void MapPropertyValues(ResolutionContext context, IMappingEngineRunner mapper, object result)<br />
{<br />
     // this is where it is failing&#8230; right at the first line<br />
     foreach (var propertyMap in context.TypeMap.GetPropertyMaps())<br />
     {<br />
          MapPropertyValue(context, mapper, result, propertyMap);<br />
     }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://elegantcode.com/2009/10/16/mapping-from-idatareaderidatarecord-with-automapper/comment-page-1/#comment-50813</link>
		<dc:creator>David</dc:creator>
		<pubDate>Mon, 30 Nov 2009 21:38:54 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/10/16/mapping-from-idatareaderidatarecord-with-automapper/#comment-50813</guid>
		<description>Could you do it with List instead of IEnumerable like so?

var views = Mapper.Map&lt;IDataReader, List&gt;(_dataReader);</description>
		<content:encoded><![CDATA[<p>Could you do it with List instead of IEnumerable like so?</p>
<p>var views = Mapper.Map&lt;IDataReader, List&gt;(_dataReader);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: andrex</title>
		<link>http://elegantcode.com/2009/10/16/mapping-from-idatareaderidatarecord-with-automapper/comment-page-1/#comment-49824</link>
		<dc:creator>andrex</dc:creator>
		<pubDate>Tue, 20 Oct 2009 10:10:02 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/10/16/mapping-from-idatareaderidatarecord-with-automapper/#comment-49824</guid>
		<description>Many years I use a great bltoolkit library for mapping and dataaccess:

public class SomeView
{
    public Int32 SomeNumber { get; private set; }
    public Guid AnId { get; private set; }
    public Double OrNothing { get; private set; }
}

// for getting list entities
using(var db = new DbManager())
  var list = db.SetCommand(SqlQueryHere).ExecuteList();</description>
		<content:encoded><![CDATA[<p>Many years I use a great bltoolkit library for mapping and dataaccess:</p>
<p>public class SomeView<br />
{<br />
    public Int32 SomeNumber { get; private set; }<br />
    public Guid AnId { get; private set; }<br />
    public Double OrNothing { get; private set; }<br />
}</p>
<p>// for getting list entities<br />
using(var db = new DbManager())<br />
  var list = db.SetCommand(SqlQueryHere).ExecuteList();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ae</title>
		<link>http://elegantcode.com/2009/10/16/mapping-from-idatareaderidatarecord-with-automapper/comment-page-1/#comment-49823</link>
		<dc:creator>ae</dc:creator>
		<pubDate>Tue, 20 Oct 2009 09:41:42 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/10/16/mapping-from-idatareaderidatarecord-with-automapper/#comment-49823</guid>
		<description>Please, any helper for Ent.Library Data Block 4.1, for reduce code lines and write elegant code ?? any suggestions ??

  Database db = DatabaseFactory.CreateDatabase(&quot;ConnectionStrings.Oracle.D04PES01&quot;);
            using (DbCommand cm = db.GetStoredProcCommand(&quot;TBL_POC_TEST_TIPOS.TBL_POC_TEST_TIPOS_FBY_PK&quot;))
            {
                db.AddInParameter(cm, &quot;P_ID_TEST_TIPOS&quot;, DbType.String, id);
                cm.Parameters.Add(CreateCursorParameter(&quot;P_REFCURSOR&quot;));

                // Using &quot;using&quot; will cause both the DataReader and connection to be 
                // closed. (ExecuteReader will close the connection when the 
                // DataReader is closed.)
                using (IDataReader dataReader = db.ExecuteReader(cm))
                {
                    if (dataReader.Read())
                    {
                        factory.Add(dataReader);
                    }
                    //while (dataReader.Read())
                    //{
                    //    factory.Add(dataReader);
                    //    break;
                    //}
                    return factory.Entity;
                }
            }
thanks in advance...</description>
		<content:encoded><![CDATA[<p>Please, any helper for Ent.Library Data Block 4.1, for reduce code lines and write elegant code ?? any suggestions ??</p>
<p>  Database db = DatabaseFactory.CreateDatabase(&#8220;ConnectionStrings.Oracle.D04PES01&#8243;);<br />
            using (DbCommand cm = db.GetStoredProcCommand(&#8220;TBL_POC_TEST_TIPOS.TBL_POC_TEST_TIPOS_FBY_PK&#8221;))<br />
            {<br />
                db.AddInParameter(cm, &#8220;P_ID_TEST_TIPOS&#8221;, DbType.String, id);<br />
                cm.Parameters.Add(CreateCursorParameter(&#8220;P_REFCURSOR&#8221;));</p>
<p>                // Using &#8220;using&#8221; will cause both the DataReader and connection to be<br />
                // closed. (ExecuteReader will close the connection when the<br />
                // DataReader is closed.)<br />
                using (IDataReader dataReader = db.ExecuteReader(cm))<br />
                {<br />
                    if (dataReader.Read())<br />
                    {<br />
                        factory.Add(dataReader);<br />
                    }<br />
                    //while (dataReader.Read())<br />
                    //{<br />
                    //    factory.Add(dataReader);<br />
                    //    break;<br />
                    //}<br />
                    return factory.Entity;<br />
                }<br />
            }<br />
thanks in advance&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Reflective Perspective - Chris Alcock &#187; The Morning Brew #458</title>
		<link>http://elegantcode.com/2009/10/16/mapping-from-idatareaderidatarecord-with-automapper/comment-page-1/#comment-49822</link>
		<dc:creator>Reflective Perspective - Chris Alcock &#187; The Morning Brew #458</dc:creator>
		<pubDate>Tue, 20 Oct 2009 07:47:34 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/10/16/mapping-from-idatareaderidatarecord-with-automapper/#comment-49822</guid>
		<description>[...] Mapping From IDataReader/IDataRecord with AutoMapper - Jan Van Ryswyck talks about the use of a patch he submitted for AutoMapper which allows mapping to and from data readers meaning you can easily remove a lot of boilerplate mapping code in those situations too. [...]</description>
		<content:encoded><![CDATA[<p>[...] Mapping From IDataReader/IDataRecord with AutoMapper &#8211; Jan Van Ryswyck talks about the use of a patch he submitted for AutoMapper which allows mapping to and from data readers meaning you can easily remove a lot of boilerplate mapping code in those situations too. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Van Ryswyck</title>
		<link>http://elegantcode.com/2009/10/16/mapping-from-idatareaderidatarecord-with-automapper/comment-page-1/#comment-49786</link>
		<dc:creator>Jan Van Ryswyck</dc:creator>
		<pubDate>Sat, 17 Oct 2009 15:32:10 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/10/16/mapping-from-idatareaderidatarecord-with-automapper/#comment-49786</guid>
		<description>&lt;a href=&quot;#comment-49783&quot; rel=&quot;nofollow&quot;&gt;@PM-SilverCrux &lt;/a&gt; If AutoMapper can run with the Compact Framework, then yes. I guess you can ask on the &lt;a href=&quot;http://groups.google.com/group/automapper-users&quot; rel=&quot;nofollow&quot;&gt;user group &lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p><a href="#comment-49783" rel="nofollow">@PM-SilverCrux </a> If AutoMapper can run with the Compact Framework, then yes. I guess you can ask on the <a href="http://groups.google.com/group/automapper-users" rel="nofollow">user group </a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PM-SilverCrux</title>
		<link>http://elegantcode.com/2009/10/16/mapping-from-idatareaderidatarecord-with-automapper/comment-page-1/#comment-49783</link>
		<dc:creator>PM-SilverCrux</dc:creator>
		<pubDate>Sat, 17 Oct 2009 10:23:35 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/10/16/mapping-from-idatareaderidatarecord-with-automapper/#comment-49783</guid>
		<description>Excellent Addition. I have a question, perhaps this a wrong place to ask but let me try anyway : Can it be tweaked to run under Compact Framework 3.5 ?</description>
		<content:encoded><![CDATA[<p>Excellent Addition. I have a question, perhaps this a wrong place to ask but let me try anyway : Can it be tweaked to run under Compact Framework 3.5 ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Eysermans</title>
		<link>http://elegantcode.com/2009/10/16/mapping-from-idatareaderidatarecord-with-automapper/comment-page-1/#comment-49782</link>
		<dc:creator>Peter Eysermans</dc:creator>
		<pubDate>Sat, 17 Oct 2009 10:19:37 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/10/16/mapping-from-idatareaderidatarecord-with-automapper/#comment-49782</guid>
		<description>Allright, great contribution. This will save me a bunch of mapping classes. It&#039;s small things like these that make your life so much better if you can&#039;t use NHibernate.</description>
		<content:encoded><![CDATA[<p>Allright, great contribution. This will save me a bunch of mapping classes. It&#8217;s small things like these that make your life so much better if you can&#8217;t use NHibernate.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

