HowTo retrive original entity as a result of a view?

Oct 5, 2015 at 9:17 PM
Hello, when I create a view is always necessary to declare a RowSchema that allows me to define the result of a view.
How can you have as a return the original entity that I stored in the database?
In your example "" you used a version that is published on codeplex. For example:
db.query (typeof (SalesInvoice)
(SalesInvoice s) => (s.Serial> s.CustomerName && j == "aaa")
I can not use it. The only way I have found is:
db.query <SalesInvoiceView.RowSchema> (x => x.Serial> x.CustomerName && j == "aaa");
The problem is that then the return is always a SalesInvoiceView.RowSchema. I used to return AutoMapper original entity. In a large scale project is a big problem.
Oct 6, 2015 at 5:00 AM
Hi Cave17!

Yes you have to define the RowSchema for each view and this is different from the original "entity".

The use of the original entity for the query predicate has been deprecated as it was confusing and the return type did not reflect the generic T given.

If you need to get the original entity use Fetch(guid). Think of the views as a quick look-up and fast processing store tailored to your needs with the option of getting the original when needed with a Fetch()
Oct 8, 2015 at 3:49 PM
Hello Gholam, your answers are always the fastest !! (such as your RaptorDb :-))

thank you.
See you soon