FUck create
http://social.msdn.microsoft.com/Forums/en/adodotnetdataservices/thread/c168d808-ac10-4a29-a04a-55421d86fed9
Thursday, March 31, 2011
Monday, March 28, 2011
bry r bry byr get the json formated response from data service
http://stackoverflow.com/questions/1145588/cannot-properly-set-the-accept-http-header-with-jquery
Saturday, March 26, 2011
Many ways
There s many ways to define metadata for model in MVC
http://bradwilson.typepad.com/blog/2010/01/why-you-dont-need-modelmetadataattributes.html
OLD school attributes still the Best. I neebet
http://bradwilson.typepad.com/blog/2010/01/why-you-dont-need-modelmetadataattributes.html
OLD school attributes still the Best. I neebet
Wednesday, March 23, 2011
Can't undersand it
Re: The controller for path /favicon.ico does not implement IController
Apr 26, 2008 12:37 AM
The Routing system no longer special-cases the period character. Take a look at the Global.asax provided with the April codeplex templates:
1 routes.MapRoute(
2 "Default", // Route name
3 "{controller}/{action}/{id}", // URL with parameters
4 new { controller = "Home", action = "Index", id = "" }, // Parameter defaults
5 new { controller = @"[^\.]*" } // Parameter constraints
6 );
Note that on line (5) above, we're constraining the controller parameter such that periods are invalid characters, so the routing system won't bother looking for the favicon.ico controller.
Try adding a similar constraint to your registered routes. Hopefully this will solve your issue. :)
And issue appears on when:
AppControllerFactory{...
public override IController CreateController(RequestContext requestContext, string controllerName)
{
//object controller = _kernel.TryGet(controllerName.ToLowerInvariant());
return base.CreateController(requestContext, controllerName);
}
WTF!!!????
Apr 26, 2008 12:37 AM
The Routing system no longer special-cases the period character. Take a look at the Global.asax provided with the April codeplex templates:
1 routes.MapRoute(
2 "Default", // Route name
3 "{controller}/{action}/{id}", // URL with parameters
4 new { controller = "Home", action = "Index", id = "" }, // Parameter defaults
5 new { controller = @"[^\.]*" } // Parameter constraints
6 );
Note that on line (5) above, we're constraining the controller parameter such that periods are invalid characters, so the routing system won't bother looking for the favicon.ico controller.
Try adding a similar constraint to your registered routes. Hopefully this will solve your issue. :)
And issue appears on when:
AppControllerFactory{...
public override IController CreateController(RequestContext requestContext, string controllerName)
{
//object controller = _kernel.TryGet
return base.CreateController(requestContext, controllerName);
}
WTF!!!????
Monday, March 21, 2011
+1 bug
/Invoke service operations from client
. The operation could only be invoked
http://localhost:51685/serv.svc/Companies no parentesis on the end allowed!!!
ServiceClient - CreateQuery works only if operation has no parameters, i.e. it creates request without parentesis on the end, as far as you add some parameter, it add parentesis and server refuse to recognaise such request WTF
The only safe way to invoke operation through execute request
var courses = proxy.Execute<Course>(
new Uri(string.Format("{0}CoursesByCredits?credit={1}",
proxy.BaseUri, 3),
UriKind.RelativeOrAbsolute));
Ups ! .NET Client doesn't support return values of complex type!!!!
Saturday, March 19, 2011
Friday, March 18, 2011
Restrictions for current version of Data Service :
--EF provider
1. Opertaion methods can only returns collections of Model Entitities, Model Complex Types or simple types.
2. Even if operation return IQueriable type all aux filter conditions wont be suppported.
Ie :
//This is model's entity or complex type
class Thing
{
int Val {get;set;}
}
[WebGet]
IQueriable GetThings()
You can't use this request :
...MyService.svc?GetThings$filter = Val eq 1
3. No operation method overridens
EF debugging here:
It worth to make some NutShell lib which will wrap this?!
Thursday, March 17, 2011
The AddQueryOption method returns a new instance of IQueryable. So you need to modify your code to do:
r = r.AddQueryOption("id", CompanyId); One other thing: The client library does not support reading responses to service operations returning enumeration of primitive or complex types. So for this to work the Equipment type must be an entity type.
Wednesday, March 16, 2011
MVC Magic
View :
using (Html.BeginForm()) {<input type="submit" value="Delete">}
Controller :
[HttpPost]
public ActionResult DeleteLink(int id, FormCollection collection)
{
}
How view determine which field is key and method contains first param for key value???
MOBY compare model.fields and controllerMethod.params? Need check
Tuesday, March 15, 2011
POST for [WebInvoke] method
Data service method Comp(...)
1. Param in SetServiceOper... and UriTemplate param value should be exect the same (The name of method itself doesn't matter)
2. Comp/1 - doesn't work here (it is strange since documentation say otherwice)
Only way to pass parameter Comp?id=1 - it's work
PUT/POST OData with fiddler
The crucial thing here : Don't fotget to include namespces to the entity tag, since all others stuff is just copy/paste from GET request. These namespaces are taken from the parent tag of entity of GET request.
Subscribe to:
Posts (Atom)