Mapper Behavior


Author
Message
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Looks like we'll be releasing this next week along with the DevExpress wrapper dll, so stay tuned.
Daniel Essin
Daniel Essin
StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)
Group: Forum Members
Posts: 235, Visits: 309
great!
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
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.  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.  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.).
Daniel Essin
Daniel Essin
StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)
Group: Forum Members
Posts: 235, Visits: 309
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?



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.
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
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.  You can only use the System.Nullable<T> type with value types (int, float, boolean, structures, etc.).  So, with string values, you will need to configure the fields to return an alternate value on NULL.  Generally, you would configure the string field to return either string.Empty or 'null' when a DBNull.Value value is returned.
Daniel Essin
Daniel Essin
StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)
Group: Forum Members
Posts: 235, Visits: 309
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.



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:

public Nullable MIDDLENAME

{

get

{

object loValue;

loValue = this.CurrentRow["MIDDLENAME"];

if (loValue == DBNull.Value)

{

return (Nullable)null;

}

else

{

return (Nullable)loValue;

}

}

set

{

if (value.HasValue)

{

this.CurrentRow["MIDDLENAME"] = value.Value;

}

else

{

this.CurrentRow["MIDDLENAME"] = DBNull.Value;

}

}

}



And the following error message when I try to compile:

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'   



What now?

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search