suggestions-questions-brainstorming icon indicating copy to clipboard operation
suggestions-questions-brainstorming copied to clipboard

Parsing of Energy/Mass seems complicatedly stringly typed and hard to machine parse

Open ryancormack opened this issue 3 years ago • 1 comments

Hi all, I was wondering if there was a reason that the Energy type (used by Calories/NutritionInformation) as well as the Mass type, which then gets added as '<Number> <Energy unit of measure>' to the value of the entity when it's used.

If there a reason the concept of a Max/Min property and a Unit property was never added to these entities?

I'm in the process of defining entity contracts and would like to stay as close to the Schema spec as possible. I have seen what I think is a Google implementation of the schema used here, which further complicates the use by using a range for calories, min-max unit, which works well for display, but complicates things for computer processing. It's of course quite possible to parse it and account for the few number of cases, but I was wondering if it was explicitly done this way for any reason?

Thanks

ryancormack avatar Oct 14 '21 14:10 ryancormack

+1.

Any chance of having this ported to Core? We're using this wonderful library very extensively in many of our projects.

maganuk avatar Jun 21 '16 20:06 maganuk

+1

hi-xiaoxin avatar Mar 23 '17 11:03 hi-xiaoxin

+1

JeanRessouche avatar Apr 14 '17 07:04 JeanRessouche

+1

j0nscalet avatar Aug 30 '17 21:08 j0nscalet

https://github.com/scaredfinger/LinqToQuerystring/pull/1

JeanRessouche avatar Sep 06 '17 16:09 JeanRessouche

@everyone - it looks like MSFT is one step ahead of us, already. Go figure.

I stumbled across 'Microsoft.AspNet.WebApi.OData' today and realized that much of the functionality I was looking for here from 'LinqToQuerystring' looks to be handled there.

Checkout:

  • (Microsoft.AspNet.WebApi.OData)[https://www.nuget.org/packages/Microsoft.AspNet.WebApi.OData/]
  • (Microsoft.OData.Stack)[http://odata.github.io/]

HTH!

j0nscalet avatar Oct 25 '17 23:10 j0nscalet