Web API 2 $expand

Hi,
Does web API 2 $expand supports only with EF or does it supports another data storages as well?
Thank You,
Sammani

Please post ASP.NET questions in the ASP.NET forums (http://forums.asp.net ).

Similar Messages

  • Web API OData $Select Option Returning All Fields

    I have a GET statement as follows:
    ...://AAA.azure-mobile.net/api/plist?$select=id,PropertyName
    where "AAA" is the my mobile service.  Even though this statement asks to return only two fields, it returns all of the field.  I don't see a syntax error but maybe there is something I am missing?  Thanks.

    Hi OliverTCOS,
    Thanks for your post to our forum.
    Your request url looks fine in my side. And if the method "plist" works fine, then the $select will select the is and propertyName field only for you. As for your scenes, I suggest you checking your server side method and make sure there is a [Queryable]
    attribute for "plist" like below.
    Collection entities:
    [Queryable]
    public IQueryable<Category> GetCategories()
    Single entity:
    [Queryable]
    public SingleResult<Category> GetCategory([FromODataUri] int key)
    And also make sure your web api odata package version supports $select and $expand.
    Besides, I suggest you taking a look at similar issue and get more information
    http://stackoverflow.com/questions/17617946/odata-select-not-working-on-web-api
    https://aspnetwebstack.codeplex.com/workitem/326
    Regards,
    Fuxiang

  • Web API commands in query_view_data

    Hi everybody!
    I´m trying to use Web API commands in the query_view_data Web Service.
    Is somewhere a HOW-TO how this works or some examples?
    Which commands can in general be used?
    thanks and best regards,
    Philipp

    refer:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a249a990-0201-0010-e18e-b2f5ed135497
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/0668a690-0201-0010-c992-cc55062ac207
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/902c3e76-fc1c-2a10-c4ab-c734b06603ba
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/22c29190-0201-0010-2f9e-b2be636b6679

  • How to call a Web Api from from a Visual webpart code behind?

    Hi,
    I am trying to create a visual web part in sharepoint 2013 with data received from another Web API.
    I followed the below steps.
    1. Created a Visual Web part.
    2. In the code behind(.cs) file I wrote the following code.
     async private void GetResult()
                using (var client = new HttpClient())
                    client.BaseAddress = new Uri("http://localhost:8080/");
                    client.DefaultRequestHeaders.Accept.Clear();
                    client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                    var response = await client.GetAsync("api/Tfs/OpenEnquiriesCount");
                    var content = response.Content;
    3. When I run the application, I get security exception in the line await
    client.GetAsync()
    What is the way to achieve this? How to call a web api from share point visual web part?
    Thank you in advance.

    Hi,
    Thanks for your sharing.
    Cheers,
    Jason
    Jason Guo
    TechNet Community Support

  • How to upload to Azure Media Services when using HTML5 with Web API

    I keep finding examples demonstrating how to upload video to Azure Media Services through a console application.  I am developing an application using HTML5 with angularjs and web api, but am having trouble finding an example for uploading when you
    are getting the file from a form on a web browser.  The main issue I find is that I see a way to upload from a file path and no way to upload from a stream.  I would like to upload the file to blob storage and then associate the file in blob storage
    with the IAssetFile object, which is then associated with IAsset.  It this possible and if so can you point me in the direction of some tutorials that demonstrate this?  Also, I am allowing site members to upload videos and images.  For this
    images scenario, I saw doc. demonstrating how to start a job that will save the image into a different size, what if I need four different sizes for each image uploaded?

    Hi,
    the following example shows how to upload a stream into a blob and associate the blob with an asset: https://code.msdn.microsoft.com/How-to-upload-a-stream-to-d2750102.
    thanks,
    Julia
    This posting is provided "AS IS" with no warranties, and confers no rights.

  • Trying to understand the various methods of the Office Web API

    Looking at the Office Web API, I don't see explanations, details of what a specific Office Web API method does. Is one suppose to experiment to discovered what they do, or is there some place I need to look for details?
    Thanks
    Jim

    ​Hi JimBassett,
    What do you mean by "Office Web API"? Do you mean javascript api for office? If so, I think you could turn to the link below for explanations, details of the methods.
    #JavaScript API for Office
    https://msdn.microsoft.com/en-us/library/office/fp142185.aspx
    If you mean the Office 365 API, here is a article for your reference:
    #Overview of developing on the Office 365 platform​
    https://msdn.microsoft.com/en-us/office/office365/howto/platform-development-overview
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

  • MS CRM 2015 :DB locking issues while calling a web API inside an asynchronous Plugin.

    Hi,
    We have a SharePoint Integration where a Web API is deployed on SharePoint Server.We are calling this Web API in asynchronous plugin. Although the Plugin works fine. But  its causing DB issues .other custom applications like schedulers are breaking
    and showing time-out issues. 
    I analysed it and found that Web API sometime failed to instantiate the Proxy object ( Exception ::System.Net.WebException: The operation has timed out ).
    This results into the exception in  plugin OR cause of DB locking. 
    Kindly suggest how to resolve this issue.
    Thanks,
    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer". Thanks and Regards, Mohammad Yusuf Ansari
    http://microxrm.blogspot.in

    ianp123,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://support.novell.com and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://forums.novell.com)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://forums.novell.com/faq.php
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://forums.novell.com/

  • Are mutliple database calls really significant with a network call for a web API?

    At one of my employers, we worked on a REST (but it also applies to SOAP) API. The client, which is the application UI, would make calls over the web (LAN in typical production deployments) to the API. The API would make calls to the database.
    One theme that recurs in our discussions is performance: some people on the team believe that you should not have multiple database calls (usually reads) from a single API call because of performance; you should optimize them so that each API call has only
    (exactly) one database call.
    But is that really important? Consider that the UI has to make a network call to the API; that's pretty big (order of magnitude of milliseconds). Databases are optimized to keep things in memory and execute reads very, very quickly (eg. SQL Server loads and
    keeps everything in RAM and consumes almost all your free RAM if it can).
    TLDR: Is it really significant to worry about multiple database calls when we are already making a network call over the LAN? If so, why?
    To be clear, I'm talking about order of magnitude -- I know that it depends on specifics (machine hardware, choice of API and DB, etc.) If I have a call that takes O(milliseconds), does optimizing for DB calls that take an order of magnitude less, actually
    matter? Or is there more to the problem than this?
    Edit: for posterity, I think it's quite ridiculous to make claims that we need to improve performance by combining database calls under these circumstances -- especially
    with a lack of profiling. However, it's not my decision whether we do this or not; I want to know what the rationale is behind thinking this is a correct way of optimizing web API calls.

    But is that really important? Consider that the UI has to make a network call to the API; that's pretty big (order of magnitude of milliseconds). Databases are optimized to keep things in memory
    and execute reads very, very quickly (eg. SQL Server loads and keeps everything in RAM and consumes almost all your free RAM if it can).
    The Logic
    In theory, you are correct. However, there are a few flaws with this rationale:
    From what you stated, it's unclear if you actually tested / profiled your app. In other words, do you actually know that
    the network transfers from the app to the API are the slowest component? Because that is intuitive, it is easy to assume that it is. However, when discussing performance, you should never assume. At my employer, I am the performance lead. When I first joined,
    people kept talking about CDN's, replication, etc. based on intuition about what the bottlenecks must be. Turns out, our biggest performance problems were poorly performing database queries.
    You are saying that because databases are good at retrieving data, that the database is necessarily running at peak performance, is being used optimally, and there is nothing that can be done
    to improve it. In other words, databases are designed to be fast, so I should never have to worry about it. Another dangerous line of thinking. That's like saying a car is meant to move quickly, so I don't need to change the oil.
    This way of thinking assumes a single process at a time, or put another way, no concurrency. It assumes that one request cannot influence another request's performance. Resources are shared,
    such as disk I/O, network bandwidth, connection pools, memory, CPU cycles, etc. Therefore, reducing one database call's use of a shared resource can prevent it from causing other requests to slow down. When I first joined my current employer, management believed
    that tuning a 3 second database query was a waste of time. 3 seconds is so little, why waste time on it? Wouldn't we be better off with a CDN or compression or something else? But if I can make a 3 second query run in 1 second, say by adding an index, that
    is 2/3 less blocking, 2/3 less time spent occupying a thread, and more importantly, less data read from disk, which means less data flushed out of the in-RAM cache.
    The Theory
    There is a common conception that software performance is simply about speed.
    From a purely speed perspective, you are right. A system is only as fast as its slowest component. If you have profiled your code and found that the Internet is the slowest component, then everything else is obviously not the slowest part.
    However, given the above, I hope you can see how resource contention, lack of indexing, poorly written code, etc. can create surprising differences in performance.
    The Assumptions
    One last thing. You mentioned that a database call should be cheap compared to a network call from the app to the API. But you also mentioned that the app and the API servers are in the same LAN. Therefore, aren't both of them comparable as network calls? In
    other words, why are you assuming that the API transfer is orders of magnitude slower than the database transfer when they both have the same available bandwidth? Of course the protocols and data structures are different, I get that, but I dispute the assumption
    that they are orders of magnitude different.
    Where it gets murkey
    This whole question is about "multiple" versus "single" database calls. But it's unclear how many are multiple. Because of what I said above, as a general rule of thumb, I recommend making as few database calls as necessary. But that is
    only a rule of thumb.
    Here is why:
    Databases are great at reading data. They are storage engines. However, your business logic lives in your application. If you make a rule that every API call results in exactly one database call, then your business logic may end up in the database. Maybe that
    is ok. A lot of systems do that. But some don't. It's about flexibility.
    Sometimes to achieve good decoupling, you want to have 2 database calls separated. For example, perhaps every HTTP request is routed through a generic security filter which validates from the DB that the user has the right access rights. If they do, proceed
    to execute the appropriate function for that URL. That function may interact with the database.
    Calling the database in a loop. This is why I asked how many is multiple. In the example above, you would have 2 database calls. 2 is fine. 3 may be fine. N is not fine. If you call the database in a loop, you have now made performance linear, which means it
    will take longer the more that is in the loop's input. So categorically saying that the API network time is the slowest completely overlooks anomalies like 1% of your traffic taking a long time due to a not-yet-discovered loop that calls the database 10,000
    times.
    Sometimes there are things your app is better at, like some complex calculations. You may need to read some data from the database, do some calculations, then based on the results, pass a parameter to a second database call (maybe to write some results). If
    you combine those into a single call (like a stored procedure) just for the sake of only calling the database once, you have forced yourself to use the database for something which the app server might be better at.
    Load balancing: You have 1 database (presumably) and multiple load balanced application servers. Therefore, the more work the app does and the less the database does, the easier it is to scale because it's generally easier to add an app server than setup database
    replication. Based on the previous bullet point, it may make sense to run a SQL query, then do all the calculations in the application, which is distributed across multiple servers, and then write the results when finished. This could give better throughput
    (even if the overall transaction time is the same).
    TL;DR
    TLDR: Is it really significant to worry about multiple database calls when we are already making a network call over the LAN? If so, why?
    Yes, but only to a certain extent. You should try to minimize the number of database calls when practical, but don't combine calls which have nothing to do with each other just for the sake of combining them. Also, avoid calling the database in a loop at all
    costs.

  • Where is the Google Web APIs Developer's Kit and developer's license key???

    Hi!
    I'm trying to follow the web services tutorial on page 490 of the Oracle JDeveloper 10g Handbook (written in 2004 so it is a little dated). Part I of the tutorial is to register with Google and download the Google Web APIs Developer's Kit, but I can't find it anywhere (at least not with that name). Does anyone know where is it?
    On a related topic, this tutorial (http://www.oracle.com/technology/oramag/webcolumns/2003/techarticles/balusamy.html) talks about a Google developer's license key (Understanding Google Web APIs section), but again, when I created a Google account I did get a confirmation email, but no second email with no key. Where do I find this?
    TIA for any help.

    what type of application?
    Here is the basic of how to use a Web service in a JSF/ADF based application:
    http://www.oracle.com/technology/products/jdev/viewlets/1013/WebServicesAndADF_viewlet_swf.html
    and this section of the how-to shows you how to create a basic Java client:
    http://www.oracle.com/technology/obe/obe1013jdev/10131/devdepandmanagingws/devdepandmanagingws.htm#t6s1

  • LightSwitch with Web API OData service not accepting Action Parameters

    I created a custom OData v3 endpoint with ASP.Net Web API 2.2 (similar to http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/odata-v3/creating-an-odata-endpoint ). I also have a Lightswitch VS 2013 update 2 HTML client that uses the
    endpoint as a data source. This configuration works pretty well.
    Problem, Actions (ActionConfiguration) works except for passing in parameters (note: I followed these instructions -- http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/odata-v3/odata-actions ). I use an ajax async HTTP request from
    the Lightswitch HTML client:
    var pUrl = 'http://localhost:58998/OData/BOMS_CATEGORY_LIST(1)/FindCatID';    
        $.ajax({
            type: 'post',       
            data: { 'CATEGORY_NAME':'Sample', 'CATEGORY_TYPE':'SUPPLY' },
            url: pUrl,       
            success: function success(result) {
                screen.propSampCatID = result.value;           
    Using Fiddler to trace, I believe the Content-Type is the problem.
    The client uses --
    Content-Type: application/x-www-form-urlencoded; charset=UTF-8
    In Fiddler, if I put a code break and then copy the entire request that comes from the client and then use that verbage exactly to submit a request from Fiddler BUT replace the Content-Type with:
    Content-Type: application/json
    it works as expected.
    Unfortunately, based on testing, specifying contentType: application/json in the ajax request does not work.
    NOTE: I just updated all the packages in the OData solution but that did not fix the problem.
    1. In general, does anyone know how to fix/what I am doing wrong?
    2. If not, any work-around suggestions?
    3. I am posting this here and on the ASP.Net-Web API forum since I am not sure where the issue lies.
    4. Aside from the parameters, the Action works as expected (i.e. a result is returned to the client)
    5. The parameters Count is 0 as opposed to the parameters being null, which tells me that the Actionconfiguration is not even adding the parameters to the Dictionary as opposed to not setting the values.
    Thanks in advance,
    Vanohrmer

    OK. I seem to have this working now. I tried a bunch of things, but I think that the issue was in my Ajax request (I had to use the JSON.stringify() function on the parameters in conjunction with the contentType of application/json):
    var pUrl =
    'http://localhost:58998/OData/BOMS_CATEGORY_LIST(1)/FindCatID';   
    var pData = {
    'CATEGORY_NAME':'Sample',
    'CATEGORY_TYPE':'SUPPLY'
    $.ajax({
    type: 'post',
    processData: false,
    data: JSON.stringify(pData),
    url: pUrl,       
    success: function success(result) {
    screen.propSampCatID = result.value;           
    dataType: 'json',
    contentType: 'application/json'

  • WCF vs Web API, Deeper details?

    Before I continue, I just want to mention I have heavily researched and searched on this topic, but I need the opinion of people who have worked/and or have practical knowledge with
    regards to this topic.
    We are currently looking at developing an API so that clients can utilize this. We are definitely set on REST as opposed to SOAP, but I am still a little unclear about what exactly the difference is, if you go down to microscopic detail.
    Having a look at msdn (Choosing which technology to use), the link below:
    http://msdn.microsoft.com/en-us/library/jj823172.aspx
    The differences are clear. However, the first point states for WCF:
    Enables building services that support multiple transport protocols (HTTP, TCP, UDP, and custom transports) and allows switching between them.
    For ASP.NET Web Api:
    HTTP only. First-class programming model for HTTP. More suitable for access from various browsers, mobile devices etc enabling wide reach.
    So, both support HTTP, but WCF supports more protocols in addition. What makes ASP.NET Web API more suitable for, I quote: "More suitable for access from various browsers, mobile devices etc enabling wide reach." if both support HTTP?
    We have until now, relied heavily on PC use. What I am getting to, and finally my question is:
    We plan on going mobile, and moving a lot more to multiple devices, browsers etc. But I just would not like to go on a service on the basis of a bit of text saying "Web API" is more suitable? IS it more efficient, less resource intensive etc.? With
    regards to future proofing? Would we be better of with WEB API and why? Just lastly, we have existing SOAP services, everything we have is built in SOAP.
    Please do not hesitate to go into detail, I am not an experienced dev, just trying to add a contribution to this project.
    Just a last couple of requirements:
    1) We plan on utilizing JSON. 2) We are limited to .NET 3.5/4. 3) Must be REST.

    Its all hype for the different products written by different product teams with incentive to get their baby adopted. Ignore them all and evaluate what you need, not what they need you to want.
    What I do know if that ASP.NET projects require a heap of infrastructure (eg IIS, and associated configuration), whereas WCF can be built as stand-alone services that just run with minimal configuration (typically registering the root URL with http.sys).
    This is the biggest win for me - recently we had some older ASP.NET projects that we had to integrate with, and what could have been an easy task with some WCF services was a huge PiTA as we had to go through a mass of setup instructions (that were not necessarily
    up to date, of course) to get something working, not to mention the installation of system services to do this.
    So you need to consider the future maintenance involved. If WebAPI requires a heap of setup, then I'd avoid it.
    There are alternatives, WWS is much more efficient as WCF and supports the same protocols (not that it matters if you're only using HTTP). If you are just building a REST API then any web server, embedded or not, will do. (eg I added Mongoose to one of my
    services recently, so now it serves http to clients as well, seamlessly and really simple though using C++ not C#).

  • Best way to write Web API

    Hi,
    I want to write the Web API ( say a json )in CQ so that I can consume this API to get some information about the content.
    I am thinking of wiriting servlets ( OSGI components ) and expose the path with selector and extension. Is this a right approach or there are some better ways to get this implementation. I need the Caching implmented as well.
    Advise on same.
    Thanks.

    post EXPLAIN PLAN
    SELECT col1,
           COUNT(*)
    FROM   tablea
    GROUP  BY col1
    HAVING COUNT(*) = (SELECT MAX(vals)
                       FROM   (SELECT col1,
                                      COUNT(*) AS vals
                               FROM   tablea
                               GROUP  BY col1
                               HAVING COUNT(*) > 1))

  • WCF and WP8.1: Can I only use WCF REST services? Then better WCF or Web API?

    I am trying to create a simple application to test WCF with WP8.1. I have created my service. Later I create my WP8.1 silver light application and I try to add a reference to my service Project. The problem is that I get an error that says that I have only
    add reference to projects that are Windows pone 8.
    I have read some solutions, but all of them are creating a WCF REST service, so my doubt if the WP8.1 applications only can connect to WCF REST services.
    In this case, if this is true, it not would be better to use Web API instead of WCF?
    Thanks so much.

    You can use any type of rest service with windows phone 8.1 because rest services can be called via the httpclient class.  You dont need a service reference.  Personally I prefer the web api but there is no reason you can not use a wcf rest service.

  • Using Application Insights in a worker role using OWIN Web API 2

    Hi,
    Great work, I'm wondering if you had any guidance on using Application Insights with a worker role hosted Web API 2 application using OWIN ?
    I'm planning to create a Delegating Handler as you don't have a Begin_Request event to issue the  ServerAnalytics.BeginRequest but anyone thoughts or guidance would be appreciated.
    We are planning to try it out over the next few days so I'll report back my findings then.
    Thanks
    John

    You can start with this (just an example, please adjust to your needs):
    public class ApplicationInsightsHandler : DelegatingHandler
    private TelemetryClient telemetryClient;
    public ApplicationInsightsHandler()
    this.telemetryClient = new TelemetryClient();
    protected override Task<HttpResponseMessage> SendAsync(
    HttpRequestMessage request, CancellationToken cancellationToken)
    DateTimeOffset start = DateTime.Now;
    return base.SendAsync(request, cancellationToken)
    .ContinueWith<HttpResponseMessage>((responseToCompleteTask) =>
    HttpResponseMessage response = responseToCompleteTask.Result;
    int statusCode = (int)response.StatusCode;
    this.telemetryClient.TrackRequest(request.RequestUri.AbsolutePath,
    start, DateTimeOffset.Now - start,
    statusCode.ToString(),
    statusCode < 400);
    return response;
    Anastasia

  • Use Web API url for loading an external image in a report

    Hi there,
    I am trying to host an image in a report, which is coming out of a Web API. I am able access the image through a URL in a browser:
    https://companytest.com/api/TestFormImage?id=10358&EntityId=6719&imgMetadataName=TestDiagram
    Can anyone please help me how to include this in a report ? I have tried to include this as an external image with the URL embedded as a string like: 
    =string.Format("https://companytest.com/api/TestFormImage?id=10358&EntityId=6719&imgMetadataName=TestDiagram")
    NOTE: the output of the Web API is an image of MIME type PNG.
    Thanks in advance!
    Regards, Laks

    To add an external image
    In report design view, on the Insert tab, click Image.
    On the design surface, click and then drag a box to the desired size of the image.
    On the General tab of the Image Properties dialog box, type a name in the
    Name text box or accept the default.
    (Optional) In the Tooltip text box, type text to display when the user hovers over the image in a report rendered for HTML.
    In Select the image source, select External.
    For an image on a report server in native mode, type a relative path to the image in the
    Use this image box—for example, ../images/image1.jpg.
    For an image on a report server in SharePoint integrated mode, or any other Web site, type a full URL to the image in the
    Use this image box—for example, http://<SharePointservername>/<site>/Documents/images/image1.jpg.
    For more information, see Specifying Paths to External Items (Report Builder and SSRS).
    (Optional) Click Size, Visibility, Action, or
    Border to set additional properties for the image report item.
        Click OK.
    Andy Tauber
    Data Architect
    The Vancouver Clinic
    Website | LinkedIn
    This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click
    "Mark as Answer" and "Vote as Helpful" on posts that help you. This can be beneficial to other community members reading the thread.

Maybe you are looking for

  • VZ In-Home Agent says I'm not connected to internet, but I am

    I tried to setup Outlook 2007 to use my verizon.net email.  Anyway I couldn't get it to work manually.  So I downloaded VZ - In-Home Agent.  Everytime I use it, it checks everything (network, wireless, router), when it gets to the point where it trie

  • Colspan and rowspan attributes in table cells

    Is there a way to add 'colspan' or 'rowspan' attributes to a cell in a table using the RoboHelp UI? Of course, it's very simple to just edit the HTML directly, but I'm preparing documents that will be used in the future by executives, and like most e

  • Forum pages scrolling extremely slowly

    Hi, Since a few days, the forum pages are scrolling very, very slowly in Firefox (and a little bit faster in IE, but it's slow anyway). I don't have any problem scrolling pages in other fora or web sites. This only happens when scrolling pages in the

  • Premiere CS 5.5 からencoreが立ち上がらない

    Premiere CS5.5 からencoreが立ち上がらないので困っております. Dynamic Link からは.DVDにmpeg2で書き出しできますが.他のファイルに出力 できません.File → Export→Media で.Export Settings で設定して.Queueをクリ ックすると.強制的に落ちてしまいます. PCの仕様は.Win 7 Home Premium  64-bit,  Corei7, 16GB, Radeon HD5500です. 解決法があればご教示ください.

  • Lion download Question

    Is the Lion download a one time only download from apple, or can you download it again if needed?