Skip to content

Exception when using date field or range of dates. #253

Answered by fuzzzerd
SKUDSIEH asked this question in Q&A
Discussion options

You must be logged in to vote

I have solved this particular issue as follows.

Create two models.

The main model that you will use:

[DataContract("YourLayout")]
public class Model
{
    [DataMember]
    // this can be helpful if your field in FileMaker is a FileMaker Date field vs a Timestamp.
    [JsonConverter(typeof(FileMakerDateFormatConverter))]
    public virtual DateTime? DateField { get; set; }
}

A model you will use to search with:

[DataContract("YourLayout")]
public class QueryModel
{
    [DataMember(Name="DateField")]
    public string DateFieldString { get; set; }
}

That allows you to use a query model with a string that actually is Serialized into the DateField that is in your database/layout but using a .…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by SKUDSIEH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants