dtretyakov / WindowsAzure

.NET library aimed at managing and querying entities from Windows Azure Storage. It can be used as LINQ to Azure Tables.
MIT License
64 stars 27 forks source link

Request to add support for decimal data types #36

Closed abbasl closed 3 years ago

abbasl commented 10 years ago

Can you please add support for entities to have decimal data types?

My entity looks like this: public sealed class Product { [PartitionKey] public string EntityType { get { return "product"; } } [RowKey] public string Sku { get; set; } public string Name { get; set; } public double Price { get; set; } }

I receive this error when I call the .AddOrUpdate method on a collection of such entities: Invalid entity member type: 'System.Decimal'.

Here is the stack trace: at WindowsAzure.Table.EntityConverters.TypeData.ValueAccessors.ValueAccessorBase1.CreateValueAccessors(ParameterExpression instanceExpression, MemberExpression memberExpression) at WindowsAzure.Table.EntityConverters.TypeData.ValueAccessors.PropertyValueAccessor1..ctor(PropertyInfo propertyInfo) at WindowsAzure.Table.EntityConverters.TypeData.ValueAccessors.ValueAccessorFactory.Create[T](MemberInfo memberInfo) at WindowsAzure.Table.EntityConverters.TypeData.Properties.RegularProperty1..ctor(MemberInfo member, String name) at WindowsAzure.Table.EntityConverters.TypeData.Properties.RegularProperty1..ctor(MemberInfo member) at WindowsAzure.Table.EntityConverters.TypeData.EntityTypeData1.GetMemberProperty(MemberInfo member, IDictionary2 nameChanges) at WindowsAzure.Table.EntityConverters.TypeData.EntityTypeData1.<.ctor>b__1(MemberInfo member) at System.Linq.Enumerable.WhereSelectListIterator2.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at WindowsAzure.Table.EntityConverters.TypeData.EntityTypeData1..ctor() at WindowsAzure.Table.EntityConverters.TypeData.EntityTypeDataFactory.b__0[T](Type type) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at WindowsAzure.Table.EntityConverters.TypeData.EntityTypeDataFactory.GetEntityTypeData[T]() at WindowsAzure.Table.EntityConverters.TableEntityConverter1..ctor() at WindowsAzure.Table.TableSet1..ctor(CloudTableClient cloudTableClient, String tableName) at WindowsAzure.Table.TableSet`1..ctor(CloudTableClient cloudTableClient)

gblmarquez commented 10 years ago

Hi,

For now Azure Table Storage does not support 'decimal'. But I'll check if we could serialize and deserializa it to string or something like to store on Azure.

Thanks, Gabriel Marquez

forgotten-warrior commented 5 years ago

@gblmarquez any updates on this topic?

dtretyakov commented 5 years ago

@forgotten-warrior, please feel free to send a pull request which brings this functionality.

artyomabrahamyan commented 4 years ago

@dtretyakov This PR brings the functionality https://github.com/dtretyakov/WindowsAzure/pull/65.

artyomabrahamyan commented 4 years ago

@abbasl @forgotten-warrior #65 is merged to master you can start using it. 4