
We
Different="'ASoftware ArchitectMicrosoft Corporation
This post is part of the transparent design exercise in the Astoria Team. To understand how it works and how your feedback will be used please look at this post.
Around
Ast)
We
(sorry,:
[QueryInterceptor("Customers")]
Expression<Func<Customer, bool>> QueryCustomers()
// retrieve the user from the environment (e.g. the currently //logged-in user)
UserDescriptor u = GetUser();
if (u.IsAdmin)
return c => true; // can see all customers
else
return c => c.CustomerAccess.Any(ca => ca.UserID ==
u.User):
// retrieve the user from the environment (e.g. the currently logged-in user):
static Expression<Func<Customer, CustomersDbContext, Dictionary<string, object>, bool>> QueryCustomers()
return (c, ctx, state) => (bool)state["IsAdmin"] ||
c.CustomerAccess.Any(ca => ca.UserID ==
(string)state["UserID"]);
void override OnStartRequest(RequestDescriptor descriptor, Dictionary<string, object> state)
state[“IsAdmin”] = u.IsAdmin;
state[“UserID”] = u.UserID;",
(c, ctx, state) => (bool)state["IsAdmin"] ||
state["IsAdmin"] = u.IsAdmin;
state["UserID"] = u.UserID;
We
Its
While
We.
Technical Lead
I've responded to a few posts on our online forums asking what the motivations were for building Astoria. After one of our recent posts to the forums a comment was left that the replies would be a good blog post. So, what follows is a few of my responses to those forums questions appended together and touched up a bit so they can be read together as a single post.
In general, the goal of the ADO.NET Data Services Framework browser) it’s interesting to note it now is:
1)Creating and maintaining rich data oriented services with current approaches requires a significant developer investment
2).
So far I’ve talked mainly about how Astoria fits into the mid-tier and makes aspects of app development easier for AJAX/RIA/etc developers. Another key trend that drove us to build the ADO.NET Data Services Framework was the observation that an ever increasing amount of data is being stored in the cloud and web-based APIs to access that data seem to be growing by the minute. A goal ADO.NET Data Services Framework is to fit into this use case by providing a way of easily creating a service that has a RESTful API and a uniform interface that plays well with libraries and tools just like in the app (AJAX, Silverlight, etc) use case described above.
This post is already getting a bit long, but in addition to the items noted above, additional advantages of REST-based approaches also apply such as rich integration with HTTP such that you can leverage existing HTTP infrastructure (ex. HTTP Proxies) deployed at large .
After writing this, I couldn't help but wonder how this aligns with the general view the developer community has of Astoria now that we have released a few CTPs and everyone can try out the bits first hand. After reading this post, did this describe your overall view of Astoria and its target use cases?
- Mike Flasko
This
We made few tweaks to our URI syntax to clean it up in the last CTP of ADO.NET Data Services. Marcelo details them here: Updates to URL syntax for December CTP of ADO.NET Data Services
-Mike
Marcelo from our team has posted a nice write up detailing how the $filter query string operator works in ADO.NET Data Services and highlights a number of the functions it supports - check out his post here: $filter Query Option in ADO.NET Data Services