LLBLGen 3.0
Runtime: 3.0.10.1025
SelfServicing, .NET 4.0
SQLServer database
I have some fairly simple code that uses an IncludeFieldList to retrieve only 1 field from the database:
IncludeFieldsList includeFields = new IncludeFieldsList(XFields.Y);
XCollection c = new XCollection();
c.GetMulti(predicate, includeFields, null);
Then, for some of the entities in the collection, I want to fetch all the fields:
XEntity x = c[0];
x.FetchExcludedFields(includeFields);
But, I'm getting Exceptions thrown in two cases:
First, my entity includes a Read-Only field (marked as such in the designer). It's not included in the IncludeFieldList, so I it should be fetched when FetchExcludedFields is called. But, I see this exception:
SD.LLBLGen.Pro.ORMSupportClasses.ORMFieldIsReadonlyException occurred
Message=The field 'RowVersion' is read-only and can't be changed.
Source=SD.LLBLGen.Pro.ORMSupportClasses.NET20
RuntimeBuild=10252010
RuntimeVersion=3.0.0.0
StackTrace:
> SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses.EntityBase.ValidateValue(SD.LLBLGen.Pro.ORMSupportClasses.IFieldInfo fieldToValidate, ref object value, int fieldIndex) Line 3707 C#
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses. EntityBase.SetValue(int fieldIndex, object value, bool checkForRefetch, bool performDesyncForFKFields) Line 2491 + 0x10 bytes C#
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses. EntityBase.SetNewFieldValue(string fieldName, object value) Line 1311 + 0x19 bytes C#
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses. DaoBase.FetchExcludedFieldsBatches(SD.LLBLGen.Pro.ORMSupportClasses.IEntityCollection entities, SD.LLBLGen.Pro.ORMSupportClasses.ITransaction containingTransaction, System.Collections.Generic.IList<SD.LLBLGen.Pro.ORMSupportClasses.IEntityField> allPkFields, int batchSize, int numberOfPkFields, int numberOfBatches, SD.LLBLGen.Pro.ORMSupportClasses.IRelationCollection relationsToUse, System.Collections.IList excludedFieldsToUse, SD.LLBLGen.Pro.ORMSupportClasses.IEntityFields resultFields) Line 2964 + 0x7c bytes C#
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses. DaoBase.FetchExcludedFields(SD.LLBLGen.Pro.ORMSupportClasses.IEntityCollection entities, SD.LLBLGen.Pro.ORMSupportClasses.ITransaction containingTransaction, SD.LLBLGen.Pro.ORMSupportClasses.ExcludeIncludeFieldsList excludedIncludedFields) Line 1934 + 0x29 bytes C#
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses. DaoBase.FetchExcludedFields(SD.LLBLGen.Pro.ORMSupportClasses.IEntity entity, SD.LLBLGen.Pro.ORMSupportClasses.ITransaction containingTransaction, SD.LLBLGen.Pro.ORMSupportClasses.ExcludeIncludeFieldsList excludedIncludedFields) Line 1859 + 0xf bytes C#
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses. EntityBase.FetchExcludedFields(SD.LLBLGen.Pro.ORMSupportClasses.ExcludeIncludeFieldsList excludedIncludedFields) Line 1179 + 0xe bytes C#
Second, one of the fields in my entity is mapped to an Enum, using the basic enum support in 3.0 (not a custom type converter). This field is not included in the IncludeFieldsList, so it should be fetched when FetchExcludedFields is called. But, I see this exception:
SD.LLBLGen.Pro.ORMSupportClasses.ORMValueTypeMismatchException occurred
Message=The value 1 is of type 'System.Byte' while the field is of type 'Auctionpay.Aesop.LLBLGenTypes.SupporterType'
Source=SD.LLBLGen.Pro.ORMSupportClasses.NET20
RuntimeBuild=10252010
RuntimeVersion=3.0.0.0
StackTrace:
> SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses. EntityBase.ValidateValue(SD.LLBLGen.Pro.ORMSupportClasses.IFieldInfo fieldToValidate, ref object value, int fieldIndex) Line 3709 + 0x1f bytes C#
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses. EntityBase.SetValue(int fieldIndex, object value, bool checkForRefetch, bool performDesyncForFKFields) Line 2491 + 0x10 bytes C#
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses. EntityBase.SetNewFieldValue(string fieldName, object value) Line 1311 + 0x19 bytes C#
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses. DaoBase.FetchExcludedFieldsBatches(SD.LLBLGen.Pro.ORMSupportClasses.IEntityCollection entities, SD.LLBLGen.Pro.ORMSupportClasses.ITransaction containingTransaction, System.Collections.Generic.IList<SD.LLBLGen.Pro.ORMSupportClasses.IEntityField> allPkFields, int batchSize, int numberOfPkFields, int numberOfBatches, SD.LLBLGen.Pro.ORMSupportClasses.IRelationCollection relationsToUse, System.Collections.IList excludedFieldsToUse, SD.LLBLGen.Pro.ORMSupportClasses.IEntityFields resultFields) Line 2964 + 0x7c bytes C#
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses. DaoBase.FetchExcludedFields(SD.LLBLGen.Pro.ORMSupportClasses.IEntityCollection entities, SD.LLBLGen.Pro.ORMSupportClasses.ITransaction containingTransaction, SD.LLBLGen.Pro.ORMSupportClasses.ExcludeIncludeFieldsList excludedIncludedFields) Line 1934 + 0x29 bytes C#
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses. DaoBase.FetchExcludedFields(SD.LLBLGen.Pro.ORMSupportClasses.IEntity entity, SD.LLBLGen.Pro.ORMSupportClasses.ITransaction containingTransaction, SD.LLBLGen.Pro.ORMSupportClasses.ExcludeIncludeFieldsList excludedIncludedFields) Line 1859 + 0xf bytes C#
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses. EntityBase.FetchExcludedFields(SD.LLBLGen.Pro.ORMSupportClasses.ExcludeIncludeFieldsList excludedIncludedFields) Line 1179 + 0xe bytes C#