ssteenkiste / nettiers

Automatically exported from code.google.com/p/nettiers
1 stars 0 forks source link

DateTimeOffset in Parameter Builder causes exception #172

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

The following code will produce an InvalidCastException:

"Invalid cast from 'System.String' to 'System.DateTimeOffset'."

 DateTimeOffset closedDate = new DateTimeOffset(DateTime.Now);

 MyService jService = new MyService();
 MyParameterBuilder builder = new MyParameterBuilder(true, true);
 builder.AppendEquals(JobColumn.ClosedDate, closedDate.ToString());
 retVal = jService.Find(builder.GetParameters());     

What version of .netTiers and CodeSmith are you using?

CodeSmith 5.x, 2.3 Templates

Please provide any additional information below.

is it as simple as adding:

else if ( conversionType.Equals(typeof(DateTimeOffset)))
    {
      newValue = DateTimeOffset.Parse(value.ToString());
    }
to EntityUtil at line 544?

Original issue reported on code.google.com by russell....@gmail.com on 17 Feb 2009 at 8:06

GoogleCodeExporter commented 9 years ago
This data type is only valid in NetFX 2.0 SP1 or later (not in 2.0 RTM)

Original comment by ejls...@hotmail.com on 17 Feb 2009 at 9:32

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 25 May 2009 at 3:30

GoogleCodeExporter commented 9 years ago
This data type came out in .NET 3.5

Original comment by bniemyjski on 25 May 2009 at 4:22