Enabling OData in ASP.NET 6.0

Поділитися
Вставка
  • Опубліковано 14 жов 2024

КОМЕНТАРІ • 81

  • @alisriti3002
    @alisriti3002 3 роки тому +3

    I am thinking of those who are watching your videos for the first time, they will immediately take an aspirin and go to sleep for a week.
    excellent video by the way.

  • @seyhmusozbek
    @seyhmusozbek 2 роки тому +2

    I wasn't expecting understand odata in just 20 minutes and don't get bored, really good work.

  • @katkovdify
    @katkovdify 2 роки тому +1

    One of the best OData introductory tutorials on UA-cam! Thank you! I especially loved the part where you troubleshoot stuff. That's where I feel I learn the most.

  • @cooolone4u
    @cooolone4u Місяць тому

    Thank you sir, a ton! I learned OData concept today with your tuition!

  • @theSAPspecialist
    @theSAPspecialist Рік тому +1

    Thanks Hassan - really the best Visual Studio OData demo I have found that actually works E2E (you're saving lives).

  • @PetarPetrov_hh
    @PetarPetrov_hh 2 роки тому +1

    I like this type of videos where u get what u look for in a very fast pace without wasting time and u get some extra bono content :D

  • @csegyud
    @csegyud Рік тому +1

    Great intro Hassan, thank you so much! Will it work with ASP.Net Core 7 too? If yes, when. Thanks.

  • @rejawebs
    @rejawebs 2 роки тому +1

    Best for oData overview.. Thanks a lot

  • @MatiasZo
    @MatiasZo Місяць тому

    Great teacher!

  • @pradeep6257
    @pradeep6257 Рік тому

    Thank u for making it simple & understandable.

  • @barwalgayatri4655
    @barwalgayatri4655 2 роки тому

    I have become ur great Fan Sir. Thank you for such a good videos
    Please add some video on JW Token in .net core i need to learn

  • @RajK09
    @RajK09 Рік тому

    Thanks for the video and you got a new subscriber here 😉

    • @RajK09
      @RajK09 Рік тому

      I'm trying to fetch data from cosmos db and implemented odata in the project (Asp.Net Core Web API built on dotnet 6).
      I applied filter expression on endpoint, it pulls all the data from cosmos and sends to client what client requested in odata filter expression.
      So far so good. But the problem is, it's fetching all the records from cosmos. Is there any way to convert the filter expression to a Cosmos query? So that I can pull the records which are required for me.
      Thanks in advance

  • @mau9175
    @mau9175 4 місяці тому

    thank you, brother! helped a lot.

  • @zeetsoft
    @zeetsoft 3 роки тому +1

    What an amazing concept. Thank you.

  • @AdamThomson
    @AdamThomson 11 місяців тому

    Thanks, really great introduction!

  • @Gabrittttt
    @Gabrittttt 2 роки тому

    Amazing video, Thanks a lot Hassan!

  • @medachref7167
    @medachref7167 3 роки тому

    this is really helpful right now integrating swagger and odata together is such a pain, i can't wait for .net 6.0 to come out

  • @ThugLifeModafocah
    @ThugLifeModafocah Рік тому

    Very good video, thank you.

  • @abdullahquhtani4247
    @abdullahquhtani4247 3 роки тому

    So proud of you 👍🏼 👍🏼👍🏼.

  • @muhammadhammad468
    @muhammadhammad468 Рік тому

    excellent video. very well explained

  • @cacowen
    @cacowen 3 роки тому +2

    When you did a search, for example, search=Name, then the items came back with Name with a capitol N, when the original data had a lower case N. That is a bit concerning if the receiver is not ignoring casing. I have never really used OData before as it seemed like a black box of sorts, but I would assume the data being returned would always be exported the same.

  • @stratoschatziioannou
    @stratoschatziioannou Рік тому

    you are amazing, man

  • @mirceah13
    @mirceah13 2 роки тому

    Really nice and handy, thanks!

  • @tippusultan1255
    @tippusultan1255 Рік тому

    would be good if you had also covered how GET, PUT, PATCH, POST, DELETE can able doe done with ODATA. Also can we string multiple filtering conditions? like get top 100&$filter by score gt 100 or something? Iam just wondering to use JsonPatch vs OData for supporting Patch for my enterprise APIs. what do you suggest?

  • @matheossg
    @matheossg 3 роки тому

    Amazing video! can you do a series on the $apply operator?

  • @nhattpam
    @nhattpam Рік тому

    Great!

  • @blueeyes9691
    @blueeyes9691 Рік тому

    nice, thanks

  • @barwalgayatri4655
    @barwalgayatri4655 2 роки тому

    Sir Kindly make video on JWT Nuget package and RefeshTokens

  • @yasaswiy
    @yasaswiy 2 роки тому

    can you demonstrate to how to enable 'Update' capability in this example? I would love to see how you can update the persons dataset

  • @Eryklok
    @Eryklok 3 роки тому +2

    Thanks for the video! Does OData modify the query sent to the database or does it only modify the result received?

    • @BetoRamirez
      @BetoRamirez 3 роки тому

      I have the same question. Did you find the answer?

    • @HassanHabib
      @HassanHabib  2 роки тому +2

      If your controller is returning an IQueryable - the query goes straight to the database. Very optimum

    • @DeepakKumar-df4ef
      @DeepakKumar-df4ef 2 роки тому

      @@HassanHabib Could you please tell how to use dto models with odata?

  • @nghiepvo4493
    @nghiepvo4493 2 роки тому

    Thank for your great video, in .net 5,6 released minimal API, so how do combine minimal API and Odata, could you please help me any idea or suggestion? Regards!

  • @RomualdSZYMANSKI
    @RomualdSZYMANSKI 2 роки тому

    Great video, thx !
    I have a question: if I add a complex type as a property of the Student class (Address with Street, PostalCode and City properties), the $select=Adress returns always an empty object.
    What should be the configuration for my example to work ?

  • @mistrydarpan74
    @mistrydarpan74 2 роки тому

    $count=true is not working in the nonEDM workflow in the latest Odata Packages(8.1), Can you please provide the hint or suggestions that how's $count will work in Odata

  • @ejlalmohammed219
    @ejlalmohammed219 2 роки тому

    thanks a lot

  • @MicheleMassari
    @MicheleMassari 2 роки тому +1

    Hi Hassan nice video thanks! But I want to know if it possible use Odata on MinimalAPI. Using the nuget Microsoft.AspNetCore.OData we get the extension method AddOData only on IMVCBuilder interface. But in minimalapi we don't use IMVCBuilder because there are no controllers. There is a way to add ODATA capabilities to minimal api endpoints? Thanks

    • @HassanHabib
      @HassanHabib  2 роки тому

      OData is not available for minimal API yet. but there's work in progress for that.

    • @MicheleMassari
      @MicheleMassari 2 роки тому

      @@HassanHabib oh ok thanks so I will wait..:

  • @enciphered7650
    @enciphered7650 2 роки тому

    Can you make a video on Authorization Library for OData ?

  • @ahmedbreaka1
    @ahmedbreaka1 2 роки тому

    Thanks Hassan for your useful videos , but how can i consume odata Api in .Net 6 , specially Microsoft Dynamics 365 Apis , it was working on .Net 5 but not available in .Net 6 , do you have a way ?
    Thanks in advance

  • @marshallnyamadzawo8553
    @marshallnyamadzawo8553 Рік тому

    How do you deal with pulling a million records and then filter? It makes it even worse when you are dealing with processed data..

  • @jacekd3
    @jacekd3 2 роки тому

    (C# ) Is it possible to add some attribute to property in odata endpoint which changes its name. I have case when I want property to have DateTime.Now name

  • @AthensDotNet
    @AthensDotNet 3 роки тому +1

    Hi Hassan
    Once again thanks for all the education you provide.
    I am getting the following error when running the app.
    "Message": "The query specified in the URI is not valid. Could not find a property named 'name' on type 'OData6Demo.Api.Models.Student'."
    I'm running vs2022 and DotNet 6.0.100-preview.5.21302.13
    Kind Regards

    • @HassanHabib
      @HassanHabib  3 роки тому +1

      It's case sensitive - try Name instead of name

    • @AthensDotNet
      @AthensDotNet 3 роки тому +1

      @@HassanHabib Thank you

  • @joshuaengel5972
    @joshuaengel5972 2 роки тому +1

    I have noticed the metadata is not returned in these calls. For instance if I am using top/skip I would expect to see a nexturl as metadata. Is this no longer true?

    • @HassanHabib
      @HassanHabib  2 роки тому

      The metadata comes back with the EDM approach for OData. I follow a non-EDM pattern where your API returned body doesn't really change at all.

  • @sayanama
    @sayanama 3 роки тому +1

    How does this work? Does the Controller fetch all the data from Service and Data Access Layer but just return the necessary fields according to the OData parameters passed to the API? In real-world scenarios, I would assume that its really inefficient to pull all the data from the DB if there are OData filters present.

    • @HassanHabib
      @HassanHabib  3 роки тому +2

      The query executes on your storage engine. Controller only exposes an IQueryable and your underlying layer materializes it.

  • @GaddiShare
    @GaddiShare 2 роки тому

    @Hassan Habib, is there a tutorial for versioning with URL segment using OData 8?

  • @panos3201
    @panos3201 Рік тому

    The tutorial is good, however there is a question. At this point if you use a database, you first fetch all data at the econtroller level and then the api filters, orderes etc. However ths is a performance hit. The query options need to apply to the db level for performance reaons

    • @HassanHabib
      @HassanHabib  Рік тому +2

      That's not true. An IQueryable is a deferred execution mechanism.

    • @panos3201
      @panos3201 Рік тому

      Right so if a decontext was injected we could have defined the query without calling .ToListAsync()?

    • @panos3201
      @panos3201 Рік тому

      I actually saw another video in the ef standup and basically my question is answered. Thank you very much! Insightful video 🙂

  • @yogendramaarisetty
    @yogendramaarisetty Рік тому

    How to make the Id field of student an autogenerated while trying to Create a Student entity and saving to DB

  • @ramiroalegre8183
    @ramiroalegre8183 2 роки тому

    Hi Gassan, how can I use $apply in asp net 6 with swagger. I can't find a way to make it work, not even by URL
    Edit: I need to use "aggregate" in $apply to make a sum of values ( filter(id eq x)/aggregate(TotalAmount with sum as Total) )

  • @pranitgawande9137
    @pranitgawande9137 2 роки тому

    Hey, OData does not work with MediatR. Any idea how to resolve it?

  • @Ikuni17
    @Ikuni17 3 роки тому

    Do the genererated swagger docs automatically add indications of the additional functionality (select, filter, order by, etc)? Thanks for the video!

    • @HassanHabib
      @HassanHabib  3 роки тому +1

      I don't think they add instruction for OData queries but it's definitely something to look at in OData NxT.

  • @HakeemOriola
    @HakeemOriola 3 роки тому +1

    How can I protect odata endpoints with oauth2? or anything you can recommend

    • @HassanHabib
      @HassanHabib  3 роки тому

      I would think it would be the exactly the same as securing any non-odata endpoints. same concept.
      I'm planning to start a series sometime before the end of the year about securing ASP.NET Core APIs and Blazor Apps.

  • @martinb.r2180
    @martinb.r2180 3 роки тому

    Magic

  • @barryvanlandeghem1909
    @barryvanlandeghem1909 2 роки тому

    Still no OdataResourceSerializer for JToken or JObject :(

  • @sudarshanneupane1796
    @sudarshanneupane1796 2 роки тому

    When I have $Select my request, it's not ending, when I put a breakpoint in the controller, the controller method is done and returned. Anyone has any idea what is causing this behavior?

  • @songlover1072
    @songlover1072 2 роки тому

    How to work with XML response with OData? I'm having a problem with it, hope anyone could help

  • @ikbenignace
    @ikbenignace 2 роки тому

    Why don't you have the metadata here and for example count=true.

  • @brandonchurch6025
    @brandonchurch6025 2 роки тому

    Whenever I upgrade .NET or OData everything seems to break or all of the APIs change

    • @HassanHabib
      @HassanHabib  2 роки тому

      Hi Brandon, is your code somewhere I can take a look at? I upgraded most of my projects to .NET 6 with OData 8.0.3 and it seems to be working okay. What kind of errors are you getting can you provide the exact text here please?

    • @brandonchurch6025
      @brandonchurch6025 2 роки тому

      @@HassanHabib Well it’s not giving me an error, but the responses are incomplete now. With .NET 5 and OData 8.0.1 I get the expected JSON responses, but with .NET 6 the response looks like this:
      $metadata#Orders”,”value”:[
      The response just ends with an open array like that.
      My startup code looks like this:
      var builder = new ODataConventionModelBuilder();
      builder.EntitySet(“Orders”).EntityType.HasKey(table => new {table.OrderId});
      services.AddControllers().AddOdata(opt => opt.Select().Filter().OrderBy().AddRouteComponents(“odata”, builder.GetEdmModel());
      The only other thing worth mentioning is my controller inherits from ODataController.
      Also, I tried with OData 8.0.3 with the same result.

  • @oj3486
    @oj3486 2 роки тому

    How do you secure an endpoint?

  • @xarzu
    @xarzu 4 місяці тому

    Is that a piano?

  • @yourdailydoseofcode
    @yourdailydoseofcode 2 роки тому

    I cannot enable $count Odata function this way

  • @avaninishantwedding1stdece706
    @avaninishantwedding1stdece706 11 місяців тому

    Hi, I like and Best OData tutorials on UA-cam. I have one query for In this version if I want to show "@odata.context" and its value so in this solution or OData Version 8.2.3. So, what I need to do?