REST Web Requests with Data Caching with ASP.NET Core Web API | Xamarin & .NET MAUI 101

  Рет қаралды 32,604

James Montemagno

James Montemagno

Күн бұрын

Пікірлер: 71
@daniel-leinweber
@daniel-leinweber 2 жыл бұрын
I just integrated the Monkey Cache into a Xamarin.Forms project. It works perfectly, thanks for the video.
@danhayworth6338
@danhayworth6338 3 жыл бұрын
you are the man ! I am using Microsoft learn, but having someone like you just brightens up the room a bit more !
@davejarcher
@davejarcher 3 жыл бұрын
Great video James. Would love to see how you use this approach with dependency injection. In fact, a video on DI and Xamarin would be epic. Thanks again.
@JamesMontemagno
@JamesMontemagno 3 жыл бұрын
On my list for sure!
@broadshare
@broadshare 2 жыл бұрын
@@JamesMontemagno Hey James, lots of good stuff in your channel. Have you done the xamarin with DI ?
@drivetrainerYT
@drivetrainerYT 2 жыл бұрын
Went into my toolbox, thanks!
@chaseroth9266
@chaseroth9266 3 жыл бұрын
Nice Video! I have used SQLite by Frank A. Krueger and LiteDB by Mauricio David for local data storage before, but never Monkey Cache. I will have to give Monkey Cache a try and thereby rely more on making HTTP request (sounds perfect for my library's sample app). Thanks for mentioning the data synchronization part as well!
@fdhsdrdark
@fdhsdrdark 3 жыл бұрын
Didn't know about Monkey Cache! Great! Thank you James!! One tiny suggestion, change the nuget icon!!
@rushas
@rushas 2 жыл бұрын
That was a great video! Thank you very much
@jhd_rmt0530
@jhd_rmt0530 2 жыл бұрын
Hi James! Thank you for your wonderful videos! I love all of them! However, I am having a hard time how to configure ASP.NET Core Web API, How to make and connect it like yours in the video. I hope you can make a video for that. Thank you so much!
@cristisandu678
@cristisandu678 3 жыл бұрын
Exactly what I needed ❤️ Thank you very much !
@billymartin6497
@billymartin6497 2 жыл бұрын
Hey, James. Great Video. Really need to see the next level... what you were talking about at the end with Online/Offline sync with asp.net Api. Please?
@broadshare
@broadshare 2 жыл бұрын
Thanks James, You briefly mentioned very important concepts on online/offline syncing as well as Xamarin DI approach and wish you could do a tut on these to explain deeper. Meanwhile I will play around with your monkey nugets mentioned
@hosaus
@hosaus 3 жыл бұрын
Hi James, Can you please do a tutorial on localizing Xamarin apps including displaying DateTime using the active UI culture?
@MetalBertoKirk
@MetalBertoKirk 3 жыл бұрын
That would be really useful!
@carmineos
@carmineos 3 жыл бұрын
Thank you for the awesome videos James!
@zephaneas
@zephaneas 3 жыл бұрын
Thank you Sir!
@danielotoo4177
@danielotoo4177 3 жыл бұрын
Hello James, good job. I enjoyed theis episode alot.
@Widgets19
@Widgets19 3 жыл бұрын
Cool, thanks james for sharing your ideas.
@hadirotafoua5381
@hadirotafoua5381 3 жыл бұрын
Hi thanks so much for such great videos .. please am building an application with xamarin also using the azure sql sever i wish to know is it's better connecting directly with connections strings or should i build an api interface .. will like to have a guide on this ..thanks
@ecksttein
@ecksttein 3 жыл бұрын
Hello James, Thank you so much for so easy to understand videos for really very common use cases of Xamarin applications! I've got one question regarding usage of HttpClient class. It is inherited from class HttpMessageInvoker that implements IDisposable interface. In your example you are using instance of HttpClient class as a static member of static class. Am I correct that for frequent Web API requests it does not make sense to create HttpClient instance each time with "using" statement or try/finally block? Is it better to follow approach with static member or add HttpClient single instance to DI / IoC Container? What is your recommendation?
@JamesMontemagno
@JamesMontemagno 3 жыл бұрын
I just have one in my service. The http client work a bit different on mobile and handle all the stuff for you so no real need to dispose
@howardhaney408
@howardhaney408 3 жыл бұрын
thanks for all your great tutorials on Xamarin; however I am desperately needing a tutorial on how to use CRUD on an AZURE SQL Serve backend through an Azure App from a mobile device. I just can't fond any good tutorials out there and I prefer you tutorial method. Can you please advise if you will do such a tutorial?
@mothunderz
@mothunderz 2 жыл бұрын
Great video James. I try to code along, but from the previous video to this one how did you setup the shared directory? I have added a shared C# project to the solution, but I get a CS0234 compile error. It seems that it cannot find any code in the "Shared" folder. Sorry for the simple question...
@tobiti34
@tobiti34 2 жыл бұрын
you need to add it as a reference to your project
@ThyVincent
@ThyVincent 3 жыл бұрын
Hey there! I've been following the series up to the Database add. I was wondering if it could be possible to highlight what the "configurations" are for the newly added Projects in this tutorial, like what packages to include in those, etc. Thanks!
@haha-hk9tx
@haha-hk9tx 3 жыл бұрын
Thank you mr.james! Learnt a ton! 💜
@hamadsalahud-din3617
@hamadsalahud-din3617 2 жыл бұрын
Very interesting video. Really liked it. Could you please give me a reference of a repo that completely implements mvvm pattering over and .net core web API. Also another question. Is there a way in .net Maui to handle the exception centrally ?
@grogirh
@grogirh 3 жыл бұрын
I've got a question... how do you create the website in which you upload and download the coffee data? I'm trying to use this to get the auth. tokens of each device when they install the app, with the purpose of sending them notifications. Thank you and thanks for the tutorial!!
@wvvwwwvvw
@wvvwwwvvw Жыл бұрын
I wonder, how come socket exhaustion is not a problem in MAUI HttpClient? Why aren't we using a HttpClientFactory or a named client?
@MehStang
@MehStang 3 жыл бұрын
Hey James, I have am using APIs to make my DTOs but had a "best practices" question. Essentially I need to make 2 API calls to get all of the data relating to my task. Would it be better to make a "container" class that holds the 2 DTO's together or should I run the 2 API calls, then merge the json output into the 1 DTO? (If so what is the best way to do that, cuz my code looks like hot garbage lol) Example: I want to return coffee name, with size and price. API 1 returns Name, + Id from database. API 2 returns ID + price for Small, med, large. Should have these be separate DTOs under 1 "container" DTO, or make 1 DTO with the info I am expecting, make the calls, and merge the data into that DTO? Thanks in advance. This video series is amazing. Cant wait to se if you go over viewmodel first navigation over view first, and how that will play a role in MAUI.
@JamesMontemagno
@JamesMontemagno 3 жыл бұрын
Hmmmm that is a great question. I would probably try to create an api on top of your other two APIs that returns the data together to cut down on calls. Graph QL is basically a solution for this or grpc, but the support is a bit lacking right now.
@MehStang
@MehStang 3 жыл бұрын
@@JamesMontemagno I love grpc, and unfortunately the code is in production and not mine to modify. :( Thank you for the reply :) Loving the content. Any idea when you might showcase view and viewmodel first nav?
@renaudgg
@renaudgg 2 жыл бұрын
James, Please guide us (me) to how you deployed your APIs? I have a Trial Azure (I have a database with 1-2 tables) and i did my Web service but I dont understand how to finish this to get an actual api and your swagger. Is there anyway you can exactly guide me or maybe do a video just on how you did this?
@JamesMontemagno
@JamesMontemagno 2 жыл бұрын
Right click publish :) Swagger - docs.microsoft.com/en-us/learn/modules/improve-api-developer-experience-with-swagger/ How to publish - docs.microsoft.com/en-us/learn/modules/publish-azure-web-app-with-visual-studio/
@renaudgg
@renaudgg 2 жыл бұрын
@@JamesMontemagno Thank you
@ajpilkerton7713
@ajpilkerton7713 3 жыл бұрын
Awesome video, but I’m wondering how you can call the API when a specific page loads instead of the calling the API on refresh. Thanks
@JamesMontemagno
@JamesMontemagno 3 жыл бұрын
Oh for sure! you would just override the OnAppearing method on the page and load data when that happens
@sirishgreen
@sirishgreen 2 жыл бұрын
I am a complete beginner. In the demo you shoe the get coffee request but when you load the page you need to do a refresh for the coffees to appear. I can't work out how to get the data loaded before the page is loaded. Or load the data in preparation before the page is opened.
@JamesMontemagno
@JamesMontemagno 2 жыл бұрын
You can override OnAppearing on the page and call the method to load data
@japgam2805
@japgam2805 2 жыл бұрын
Hi James, I been watching your series. It is quite inspiring. I have question for the ObservableRangeCollection Grouping, how can I consume that part with my rest web api? I had created an API to get all the Roaster. How can I use it into the Add or AddRange? Below is the part of Refresh function. var coffees = await ApiCoffeeDataStore.GetCoffee(); Coffee.AddRange(coffees); var groupings = await ApiCoffeeDataStore.GetCoffeeGroupings(); CoffeeGroups.AddRange()???
@AlexBlount
@AlexBlount 3 жыл бұрын
Top tips right here!
@renaudgg
@renaudgg 2 жыл бұрын
James, if you read this.. my postAsync is getting me error 400 BadRequest, but if I get the Json data with a breakpoint and try it out in swagger ui it does work! any idea what would make it not work in visual studio ?
@JamesMontemagno
@JamesMontemagno 2 жыл бұрын
Are you doing it over http or https? If it is just http then you need to do network config setup to allow clear text
@renaudgg
@renaudgg 2 жыл бұрын
@@JamesMontemagno James I figured it out… after 2 weeks haha. I checked for vs2022 updated and i had a new one version i think 17.3.1 and after it worked… crazy.
@coffeemugftw
@coffeemugftw 3 жыл бұрын
How did you create the .Shared and .WebAPI projects? What are you using?
@JamesMontemagno
@JamesMontemagno 3 жыл бұрын
I created a simple .NET Standard Class Library.
@coffeemugftw
@coffeemugftw 3 жыл бұрын
@@JamesMontemagno I actually googled "shared files in xamarin" and it pointed to an old blog you made. montemagno.com/adding-shared-projects-support-for-xamarin-in/#:~:text=With%20your%20shared%20project%20in,and%20ready%20to%20share%20code. What is the difference between this "shared" file in your blog and the one in your videos?
@CraxGaming
@CraxGaming 3 жыл бұрын
Can you do a video on refreshing data from a db on nagivating to a page?
@willievs
@willievs 3 жыл бұрын
Thank you so much for this. I got my WebAPI working as well as my Android simulator but battling to get my IOS talking to the WebAPI on my localhost. I am running it from my phone, no emulator. Keep on getting "no Internet connection" but I suppose it has something to do with the http vs https (running on 192.168.10.49). I have tried numerous methods but I am not getting this right. Any recommendations?
@JamesMontemagno
@JamesMontemagno 3 жыл бұрын
When I test on a device I would deploy or use ngrok to create a full URL. Devices, IPs, and certs are tricky.
@willievs
@willievs 3 жыл бұрын
@@JamesMontemagno Used ngrok. Thank you so much
@karimhesham6500
@karimhesham6500 3 жыл бұрын
Could you please cover consuming web services in Xamarin.Forms for example asmx SOAP web services?
@JamesMontemagno
@JamesMontemagno 3 жыл бұрын
I am not a SOAP expert, but checkout docs.microsoft.com/en-us/xamarin/xamarin-forms/data-cloud/web-services/asmx
@karimhesham6500
@karimhesham6500 3 жыл бұрын
@@JamesMontemagno I tried following the documentation and also tried following some samples, but I seem to have issues implementing the proxy class. So,I was wondering if there was a more direct way to invoke the web service. Anyways, thank you for your reply and keep it up, really appreciate your efforts.
@Nithinjoykk
@Nithinjoykk 3 жыл бұрын
Super cool
@anujyadav471
@anujyadav471 3 жыл бұрын
you should do the video and make the program from the start, I couldn't get many parts of it
@JamesMontemagno
@JamesMontemagno 3 жыл бұрын
See my 10 playlist where I do just that and of course all the code is on GitHub kzbin.info/aero/PLwOF5UVsZWUiHY1CkRVjYJ6dm0iCvAlfw
@dhirenpathak
@dhirenpathak 2 жыл бұрын
Great
@RaabStephan
@RaabStephan 3 жыл бұрын
This typically works for me, first time seeing this error: "Javax.Net.Ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found."
@JamesMontemagno
@JamesMontemagno 3 жыл бұрын
Take a look at stackoverflow.com/a/58560169 it may have to do with your certs or something with your local machine.
@RaabStephan
@RaabStephan 3 жыл бұрын
@@JamesMontemagno This ended up working for me: stackoverflow.com/questions/58376095/xamarin-java-security-cert-certpathvalidatorexception-trust-anchor-for-certifi
@abdulazizalzayed2979
@abdulazizalzayed2979 3 жыл бұрын
Rock ya!
@danielotoo4177
@danielotoo4177 3 жыл бұрын
Can you make a tutorial on firebase?
@dotnetdevni
@dotnetdevni 3 жыл бұрын
Can this be used in web apis as well to cache data
@JamesMontemagno
@JamesMontemagno 3 жыл бұрын
For web apis in asp.net core you should be able to set the cache time on the app itself so would be no need from my understanding
@oktjona
@oktjona Жыл бұрын
things are hard
@SecondAlias
@SecondAlias 2 жыл бұрын
A barrel of monkeys huh
Styling Xamarin.Forms Apps with Reusable Resources & Styles
19:27
James Montemagno
Рет қаралды 15 М.
Xamarin.Forms & .NET MAUI Shell Navigation for Beginners
20:14
James Montemagno
Рет қаралды 40 М.
CAN YOU DO THIS ?
00:23
STORROR
Рет қаралды 47 МЛН
Random Emoji Beatbox Challenge #beatbox #tiktok
00:47
BeatboxJCOP
Рет қаралды 51 МЛН
小丑揭穿坏人的阴谋 #小丑 #天使 #shorts
00:35
好人小丑
Рет қаралды 37 МЛН
RAG & LLM Basics: Simplified Guide !!!( IN TELUGU)
26:05
Middleware Pattern For HttpClient With Delegating Handlers
17:07
Milan Jovanović
Рет қаралды 16 М.
Xamarin.Forms ListView vs. CollectionView - Which to use and why!
20:14
James Montemagno
Рет қаралды 31 М.
XAML for Beginners - Xamarin.Forms & .NET MAUI XAML
28:10
James Montemagno
Рет қаралды 76 М.
200 IQ Plays in badminton
5:36
Shuttle Strong
Рет қаралды 664 М.
.NET Framework vs .NET Core vs .NET vs .NET Standard vs C#
25:14
IAmTimCorey
Рет қаралды 559 М.
CAN YOU DO THIS ?
00:23
STORROR
Рет қаралды 47 МЛН