This website is intended as archive for old content and forums.
Please visit http://opf3.codeplex.com for the project's new website.

General Discussion

FORUM TOPIC

What is Opf3? Why is Opf3? How is Opf3? All these burning questions and issues discussed here.

RSS
Miguel
Posted on the 02/27/09 4:31 PM
Linq queries
Reply Quote
 I've got two main questions. First: Why don't these forms have a search feature, or wiki? Second: How can I return a standard non-enumerable array from a single column using linq? The scenario is that I need an decimal array of measurements from my object.

Here's what I've come up with so far

decimal[] SieveEntrySpecifications = ( from x in _context.GetPersistents<MaterialSpecifications>() where x.MaterialId == MaterialId select x.MeasurementSpecification ).ToArray<decimal>();

but I'm thrown a Cannot create mapping for type 'System.Decimal' without persistent attribute. exception.

Any ideas?

Thanks in advance.

Christian Liensberger [Moderator]
Posted on the 02/28/09 3:58 PM
RE: Linq queries
Reply Quote
 Hi!

1) this forum is maintained by me... i haven't gotten around to implement a specific search for the forum. There's a search site feature in the bottom of this page.

2) You need to create a persistent object that has a property that holds the decimal. Opf3 maps everything that is returned by the database to a persistent object. Decimal is none of that kind and therefore the exception is thrown.

-Christian

All times are in GMT.