Skip to content

Commit

Permalink
Test update with CustomConvertToDbMethod
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Qu authored and Victor Qu committed Oct 19, 2024
1 parent 4eb1bea commit 13526ff
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/RestfulSample/Controllers/WeatherForecastController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ public class Weather
[Select("Name"), Where, OrderBy, Update]
public string Name { get; set; }

[Select("Value"), Where, OrderBy, Column(IsJson = true), Update(Field = "Value")]
public string V { get; set; }
[Select("Value"), Where, OrderBy, Column(IsJson = true, Type = System.Data.DbType.String, CustomConvertToDbMethod = "RestfulSample.Controllers.Weather.C"), Update(Field = "Value")]
public object V { get; set; }

[Select("json_extract(Value,'$.a')")]
public string Vv { get; set; }
Expand All @@ -90,5 +90,10 @@ public class Weather
EXISTS(SELECT 1 FROM Weather e WHERE e.name = a.name and e.name {field} LIMIT 1)
""")]
public string SKU { get; set; }

public static object C(object c)
{
return System.Text.Json.JsonSerializer.Serialize(c);
}
}
}

0 comments on commit 13526ff

Please sign in to comment.