Does PetaPoco also support OData like Entity Framework? - odata

Can I use oData with PetaPoco also? I have a requirement where I need to filter the records by passing more than one input parameters. The method will be a WebAPI method.

I got the answer, At the time exploring this link, I found this quote "Web API OData does not require EF. Use any data-access layer that can translate database entities into models."
It means PetaPoco should also support OData.

PetaPoco maintainer here.
No PetaPoco doesn't support OData and most likely never will.
The reason why is the mapping to and from OData for all supported DBs would be a too much work.

Related

Custom queries with Breeze JS (Fiql + Breeze)

Im new to breeze js, I understand that breeze has it's own query language related to OData
But I am trying to get breeze js working with a custom query language, as an example FIQL is
one of the form to make queries to backend, can we get breeze run with this type of query language.
Overview of FIQL :-
http://jaxenter.com/tutorial-smarter-search-with-fiql-and-apache-cxf-46876.html
(this is not a technical answer, at the very most it's an advice)
As mentionned from their website documentation :
Today, out of the box, the Breeze product ships with adapters for the
ASP.NET Web API and for OData. It also ships with .NET components that
interface with the Entity Framework and that generate Breeze metadata
from an Entity Framework model; that EF model could be developed code
first or database first. The Breeze client is in no way limited to
these technologies; they are merely the first backend components
available; we’d be thrilled to help you adapt Breeze to your preferred
server stack.
First question is whether
1) you want breeze to actually create FICL queries on the client and send them to a FICL service. This involves translating a client side breeze EntityQuery into FICL url syntax. If so you would need to create a new a 'uriBuilder' adapter.
2) you want to translate a breeze query already sent to your service into FIQL syntax on the server so that you can further refine the query and then send it on to your FICL service. If so you would need to create a breeze DataService endpoint.
Both of these are certainly possible.
If you are looking at the 1st option, take a look at the 'b000_uriBuilder.xxx' files in the breeze GitHub repo under the 'src' directory. There should be two 'uriBuilder.xxx' files, one which translates an EntityQuery into OData syntax and another that translates the EntityQuery into a new 'json' query syntax. There is also additional information on this 2nd syntax here:
http://www.getbreezenow.com/documentation/query-using-json
Both of these 'uriBuilder's make use an internal 'visitor' framework that we have not yet documented but should be reasonably understandable by looking at the source.
If you are looking at the 2nd option, I would recommend looking at the link mentioned above and then taking a look at the 'breeze.node.js' repo and the 'breeze-sequelize' subdir within it. In this repo we take a serialized server side breeze EntityQuery and translate it into a 'Node' Sequelize query that we can apply to a variety of backends.
Another option is to contact our professional services arm, at breeze#ideablade.com and ask them to assist in building the adapters for you or to ask for more detailed technical help.

Breeze with third party API

Is it possible for Breeze to access a third party API that does not have a "BreezeController" nor supports OData?
"BreezeController" is simply a .NET attribute that helps .NET WebApi provide support for query filtering and ordering via OData "syntax" and well as json serialization support for entity graphs and type identity. Type identity is important so that breeze can track the entities within its entityManager and merge the results of queries and update relation properties. OData itself is never required.
If you don't want the ability for the client to add filtering and ordering instructions to the server, you can write your own attribute that simply provides the json serialization support. The json serialization consists simply of configuring the json.net formatter that web api is already using.
The source for the BreezeControllerAttribute may be found in the Breeze.WebApi project and is really pretty short. Just create your own 'FooControllerAttribute' by copying the 'BreezeControllerAttribute' and remove the IFilterProvider code.
On the other hand, the query and filtering support won't hurt anything and this logic isn't even applied unless you use the EntityQuery 'where' 'orderBy' 'select' or 'expand' methods, so unless you want to explicitly remove this ability there is no need to not use the 'breezeControllerAttribute'

OData Any and All with JayData or Breeze

OData supports Any and All, which helped me a lot in my previous project. Now I use JayData to avoid writing OData query strings, but haven't found results by searching for any() and all().
Is there any existing functionality or plans to implement it?
I checked Breeze.js, but the result is the same.
Updated post: 11/25/13
As of Breeze 1.4.6, 'any' and 'all' operators are now supported.
See: http://www.breezejs.com/documentation/query-examples
Older post
For Breeze, we should have support for both any() and all() within the next two months for both our WebApi and OData providers.
Standard JavaScript array.some() and array.every() functions are compiled to OData Any and All operations, so the API follows the JavaScript terminology, to hide the differences between different data sources.
Detailed blogpost - Using some() and every() with JayData OData provider
The provider capability matrix show that these operations are supported only by OData provider.

How to call stored procedures from mvc3?

I'm trying to use mvc3. The online documentation says how to connect one class to one table. anybody have a suggestion on how to run stored procedures and return the results to a view?
MVC is not responsible for the way you access your data. There are many technologies that you can use including
Plain old ADO.NET
LINQ to SQL
NHibernate
Entity Framework
LINQ to SQL is probably the easiest way to get it working without any prior knowledge. Check out Scott Gu's post http://weblogs.asp.net/scottgu/archive/2007/08/16/linq-to-sql-part-6-retrieving-data-using-stored-procedures.aspx

usefulness of microsoft data access application

I am planning to start learning asp.net mvc. And also I want to learn Microsoft's Data Access application block. But I dont want to waste time in MDAC block if theres a better option to go for, or if MVC provides any good feature than MDAC. As I have heard MVC architecture automatically generates code.
So, please guide me regarding this. Thanks in advance.
It's not part of MVC per se, but I'd recommend using LINQ to SQL or LINQ to Entities (Entity Framework) over the Data Access application block if you're interested in a pure MS object relational mapping. You could also look at nHibernate or a variety of other ORMs to accomplish this. Any of these would suffice as the basis for the M(odel) in an MVC application.
Try the Nerddinner example application, there is also the data access included. The tutorials are extensive: http://www.asp.net/mvc/learn/
Don't work with MDAC block if you are not forced to! Try NHibernate, Entity-Framework or LINQ instead.

Resources