﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » Mapper Behavior</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 04:38:44 GMT</lastBuildDate><ttl>20</ttl><item><title>Mapper Behavior</title><link>http://forum.strataframe.net/FindPost1113.aspx</link><description>I just did a rebuild of a bo and the partial class after the rebuild had a blank namespace instead of what had been there before.&lt;br&gt;
&lt;br&gt;
Also, I was doing this to get rid of the dreaded NULL error message when there is a null field in the result set. The default behavior of this is really less than useful - in fact it is a pain in the butt. So I thought that I would change the fields in the mapper to nullable generic. Having done so I get code like this:&lt;br&gt;
        public Nullable&lt;System.String&gt; MIDDLENAME&lt;br&gt;
        {&lt;br&gt;
            get&lt;br&gt;
            {&lt;br&gt;
                object loValue;&lt;br&gt;
                loValue = this.CurrentRow["MIDDLENAME"];&lt;br&gt;
                if (loValue == DBNull.Value)&lt;br&gt;
                {&lt;br&gt;
                    return (Nullable&lt;System.String&gt;)null;&lt;br&gt;
                }&lt;br&gt;
                else&lt;br&gt;
                {&lt;br&gt;
                    return (Nullable&lt;System.String&gt;)loValue;&lt;br&gt;
                }&lt;br&gt;
            }&lt;br&gt;
            set&lt;br&gt;
            {&lt;br&gt;
                if (value.HasValue)&lt;br&gt;
                {&lt;br&gt;
                    this.CurrentRow["MIDDLENAME"] = value.Value;&lt;br&gt;
                }&lt;br&gt;
                else&lt;br&gt;
                {&lt;br&gt;
                    this.CurrentRow["MIDDLENAME"] = DBNull.Value;&lt;br&gt;
                }&lt;br&gt;
            }&lt;br&gt;
        }&lt;br&gt;
&lt;br&gt;
And the following error message when I try to compile:&lt;br&gt;
The type 'string' must be a non-nullable value type in order to use it as parameter 'T' in the generic type or method 'System.Nullable&lt;T&gt;'	&lt;br&gt;
&lt;br&gt;
What now?&lt;br&gt;</description><pubDate>Tue, 09 May 2006 13:44:48 GMT</pubDate><dc:creator>Daniel Essin</dc:creator></item><item><title>RE: Mapper Behavior</title><link>http://forum.strataframe.net/FindPost1170.aspx</link><description>Looks like we'll be releasing this next week along with the DevExpress wrapper dll, so stay tuned.</description><pubDate>Tue, 09 May 2006 13:44:48 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Mapper Behavior</title><link>http://forum.strataframe.net/FindPost1164.aspx</link><description>great!</description><pubDate>Tue, 09 May 2006 12:00:43 GMT</pubDate><dc:creator>Daniel Essin</dc:creator></item><item><title>RE: Mapper Behavior</title><link>http://forum.strataframe.net/FindPost1150.aspx</link><description>Yes, I just completed the Customization Wizard for the BOMapper that allows you to select 1 or more fields (up to all fields on all business objects) and apply the settings to all of them at the same time.&amp;nbsp; I'm not sure when we'll be putting together the beta install for the next version, but I might be able to get you the DLLs.&amp;nbsp; You would have to replace all of them because there have been some major changes to the references (to remove the pesky warning about different versions of the same assembly, 1-click deployment problems, etc.).</description><pubDate>Tue, 09 May 2006 08:39:46 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Mapper Behavior</title><link>http://forum.strataframe.net/FindPost1141.aspx</link><description>Since I mostly use string fields, and most allow nulls, it is ALOT of work to manually set each one to return "" on dbNull. Isn't there some way to set a default or apply the same setting to all string fields in a table and then change the 1 or 2 that require different handling?&lt;br&gt;
&lt;br&gt;
CSLA has a "smart string" and "smart date" that do this automatically. When a dbNull occurs, the string automatically returns string.Empty and the date can return either string.Empty, a min or a max value depending on a config flag.</description><pubDate>Mon, 08 May 2006 19:08:20 GMT</pubDate><dc:creator>Daniel Essin</dc:creator></item><item><title>RE: Mapper Behavior</title><link>http://forum.strataframe.net/FindPost1120.aspx</link><description>You cannot use a nullable generic data type with a string because the System.String type is not a value type but a reference type.&amp;nbsp; You can only use the System.Nullable&amp;lt;T&amp;gt; type with value types (int, float, boolean, structures, etc.).&amp;nbsp; So, with string values, you will need to configure the fields to return an alternate value on NULL.&amp;nbsp; Generally, you would configure the string field to return either string.Empty or 'null' when a DBNull.Value value is returned.</description><pubDate>Mon, 08 May 2006 08:19:27 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>