Skip to content

Commit

Permalink
cast to string
Browse files Browse the repository at this point in the history
  • Loading branch information
KatKatKateryna committed Jun 20, 2024
1 parent 46caeaf commit 531551a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ public List<FieldDescription> GetFieldsFromSpeckleLayer(VectorLayer target)
{
// get all members by default, but only Dynamic ones from the basic geometry
Dictionary<string, object?> members = new();

// leave out until we decide which properties to support on Receive
/*
if (baseObj.speckle_type.StartsWith("Objects.Geometry"))
{
members = baseObj.GetMembers(DynamicBaseMemberType.Dynamic);
Expand All @@ -116,6 +119,7 @@ public List<FieldDescription> GetFieldsFromSpeckleLayer(VectorLayer target)
{
members = baseObj.GetMembers(DynamicBaseMemberType.All);
}
*/

foreach (KeyValuePair<string, object?> field in members)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public static FieldType FieldTypeToNative(object fieldType)
{
return fieldType switch
{
FieldType.String => value.ToString(),
FieldType.String => Convert.ToString(value),
FieldType.Single => Convert.ToSingle(value),
FieldType.Integer => Convert.ToInt32(value), // need this step because sent "ints" seem to be received as "longs"
FieldType.BigInteger => Convert.ToInt64(value),
Expand Down

0 comments on commit 531551a

Please sign in to comment.