Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 996817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:56:18+00:00 2026-05-16T06:56:18+00:00

Quick question regarding Automapper. I’m mapping data from an incoming web service, where datetimes

  • 0

Quick question regarding Automapper.

I’m mapping data from an incoming web service, where datetimes fields are not null, but sometimes have the value of DateTime.MinValue as a work-around (I don’t own this service so I’m at their mercy I’m afraid). I’m mapping from those objects to Linq To Sql objects created off of a db model I created based on the service description.

Everything is working fine, until I try to submit new rows where DateTime.MinValue is set on the datetime fields. Of course, the solution is to replace DateTime.MinValue with SqlDateTime.MinValue.Value as Sql Server chokes on DateTime.MinValue.

I would like to do this automatically with the mapping… that is, replace this on any datetime fields in the incoming web service call without having to specify on a field by field basis.

Formatters won’t do the trick since they only deal with string formatting, and IValueResolver doesn’t appear to do what I need either. That appears to be called once per instance of the parent type, not per field within the type (I tried to use it with .ForAllMembers()). Perhaps I did something wrong.

If the NullSubstitute method was generic — that is, if the signature was something like Substitute<T, Func<T,T>>, then I think I’d be in business.

Documentation / online samples haven’t provided much in the way of direction… and while I could start digging through the source, I was hoping someone with more in-depth knowledge of the system could comment (Jimmy?).

I would assume that something like this should be a feature somewhere, but then again, there may be other issues at play which complicate implementing something like this.

Thanks in advance for any assistance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T06:56:19+00:00Added an answer on May 16, 2026 at 6:56 am

    Would TypeConverter help?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I have a quick question regarding json responses from the web services, I
I have a quick question regarding getting a specific value from a data grid,
I have a quick question regarding memory management that I am not quite sure
Quick question regarding database design; Given I'm storing User data in a database, I
Quick question regarding Google Maps, AJAX and some back end data. How would I
Quick question regarding memory management in C++ If I do the following operation: pointer
Quick question regarding delegateEvents in a View - can we specify multiple event bindings
A quick question regarding the java.lang.VerifyError exception. Suppose I get an error that looks
I have a quick question regarding debug and release in VS 2008. I have
I am somewhat new to LINQ and have a quick question regarding deleting. Say,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.