-
Hello, public Model model = new Model() { dateVariable = new DateOnly (2022,10,04) } I would also like to know how to query for a range of dates like we do in filemaker. ( 2022-10-01... 2022-10-30) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
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 QueryModel query = new QueryModel { DateFieldString = "10/01/2022..10/04/2022" };
QueryModel result = await client.FindAsync(query);
// this is where I'd use automapper to make this more consistent
Model model = new Model { DateField = result.DateField }; Hope that is helpful. |
Beta Was this translation helpful? Give feedback.
I have solved this particular issue as follows.
Create two models.
The main model that you will use:
A model you will use to search with:
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 .…