BrandGhost

LIVE CODING - Bye Bye, WordPress! Let's Start Migrating To Blazor!

It's time! WordPress on AWS LightSail has been non-stop problems for nearly 2 years now. Time for a change. I'll be looking into using LinkDotNet.Blog by Steven Giesel as my blog engine of choice. But migrations are never easy, so this will be the first of many sessions trying to figure out how I can get my blog setup before going live. Remember -- I need to keep as many links active as possible so I don't ruin my SEO!
View Transcript
I don't have to worry about kicking off Instagram for this stream because uh vertical video does not do so well for live coding so we're not going to worry about that too much um but just double checking it looks like everywhere else is coming through um I do have two special guests today and uh one of them you can see currently so special guest number one this is veto veto is one of our our kittens I guess they're not I don't know when they're not kittens anymore he's a cat he's still young so there's one Vinnie is the other special guest so we have Vinnie and Vio joining me today but um Vinnie's really funny because he's always climbing on stuff so Vinnie as soon as I opened the door to the office Vinnie did what he normally does which is either one of two things he will go over to the couch and start using it as a scratching post which is awful I hate it um or the other thing that he does is that he just immediately goes up to the couch and goes and like slinks underneath it so uh special guest number two Vinnie is currently underneath the couch and I'm sure he'll pop out at some point while I'm streaming here so uh welcome to both the special guests there's veto taking off see you later buddy okay um now the problem is that veto is the the trickster so he's he looks like he's all commmon stuff right now but veto is definitely going to be causing problems he's like he's very curious very curious and uh and needs attention a lot of the time so he might be jumping up um he's kind of like the typical cat like persistent on climbing on your keyboard and things like that so we'll see how he does on this stream but so far if I can turn my camera a little bit you can see it's very uh it's not focusing but he's basically sleeping in front of my whiteboard so um we're safe for now but not for long but anyway today we're going to be doing some live coding um the goal is to get to coding but uh ultimately what I'm trying to do here is migrate my WordPress blog over to a Blazer blog engine so um this is a stressful thing for me um the thought of of it like just makes me feel not so great um I feel like if uh if I can equate it to something else for people that have had to uh to have a big move for your house and stuff like the the stress leading up to that because it's just a lot of stuff that has to get done um that's kind of how I feel right now and the problem is that like I really desperately need to move off of Wordpress um so my blog set up right now now is WordPress and light sale and the combination of the two I don't think it's necessarily light sale uh but my WordPress setup is basically every two to 3 days is just crashing um I can't I can't tell why it's got to be some plugin um I have tried turning off plugins I've tried uh like word fence is one of them in particular that I've seen can chew up a lot of CPU but what I observe with my blog is that once it's not respond responsive if I check out on light sale what's up it's usually some type of like ridiculous uh CPUs it just starts out of nowhere and then uh kills things so either what will happen is like the processes that are running uh like so whether it's WordPress itself or ouch see veto is already climbing my leg um I knew this might be a challenging thing to do but he's he's getting me good good thing I got uh jeans and not shorts on so uh I observe that the CPU climbs up ridiculously high and either kills off the processes and then I just have to restart them or it gets even worse which is and I don't know I don't know how this is possible uh it seems like there should be a way around this but it chews up so many resources that the like the VM and the container inside of it basically aren't able to communicate so I literally have to kill off the the the VM and it really sucks because it takes a while so I and when I say a while I mean it's not like hours but up to 10 minutes and it's not like I have like a million users per second to my blog but it sucks I don't want to have to like every couple of days go be like oh I guess it's time to go restart my blog um it's pretty crappy so um so I'm seeing questions in the chat yes link to my blog is here so need an extra slash in there this is my blog um and on YouTube Hey there why doesn't uh LinkedIn live have a chat feature it should um so if you actually notice uh Frederick here is is on LinkedIn and it's working it's just that they use a commenting feature instead so LinkedIn you I guess I don't I should actually join so I'm in there oh yeah it's really just the mment so if you leave a comment it shows up in the chat kind of kind of weird but that's just how it works um I wanted to fake devx I wanted to SL new line not send sorry anyways hi yep good to see you uh yeah great to see there's a bunch of people from YouTube I guess this is a good time usually Twitter is definitely still uh winning in terms of number of users but um YouTube is is doing pretty good this morning so uh so for folks folks that are new to my live streams and stuff I try to on Tuesdays do more live coding at 7: a.m. PST but um I haven't been keeping up with that just for a whole bunch of reasons like I was sick for a bit I had on call at one point um yeah just like a bunch of stuff didn't line up too well so I try to keep this time for live coding and then the other live stream I do is the night before um so I just moved yesterday's live stream to 7:00 p.m. mpst to to make it a little bit earlier for folks that one if you're more interested in like uh career stuff General software engineering not necessarily live coding that's the the live stream that I would recommend this one is usually more Hands-On um now in full transparency like my goal is to start with this blog engine which we're going to jump over to in a second uh I don't think I'm I'm not going to be fully migrating my blog in like a a single session like this but I want to get familiar with the blog engine that I'm going to be using uh it's from uh Steven and I don't know how to say his last name properly Steven uh gel I believe and uh so he's a popular net Creator I think a lot of uh CP and net developers are familiar with him so um I'm going to be using his blog engine and I guess the goal of this is I want to be able to run it locally I want to see the format of the post in the database and then uh probably something that I will do at least investigate a little bit more is off stream I will try to look at the format of blog post in WordPress and see what I have to do because um WordPress so to to explain what's going on here this uh Blazer blog engine is going to be in markdown all of the formatting and WordPress yes you can write blog post in markdown but um I don't know I believe they're probably stored in like full HTML because how the plugins work like when I look at the HTML there's a lot of extra tags and things like that so I have not yet explored what that's going to look like but um I'm probably going to have to write like a bulk converter that will get me most of the way and maybe I can live stream that but I anticipate the format of my blog is going to be a pain in the butt but a solvable process there's only so many blog posts so I'm not too concerned about that the other I to call it a concern it's not really that big of a deal but um I don't want to have when I migrate over I'm I'm basically I'm not standing up a new domain I'm keeping my domain and it's going to mean that I have my running WordPress site and eventually when this one's running the Blazer site I'm just going to point to the new site now if there are links and stuff so if I have pages that aren't blog posts this is the other sort of concern pages that aren't blog posts I need to make sure that I can set up those pages on the new site so landing pages for things like my courses and stuff like that I want to make sure that all of the links that I've been sharing out online suddenly Don't Break um that could harm SEO that could make it really weird for people to come across some of my content and be like this doesn't Point anywhere so I want to make sure that I'm doing a good job in understanding how this blog engine can support that um it might not be something that Steven had to add which is totally fine because we have the source code if I need to like again I haven't this is going to be the very first time that I look at this so if I need to modify it then I have code to do so um if I chat with Stephen and he's interested in what I changed then we can talk about uh feeding that back in but uh ultimately my goal is just to make sure that I can get my blog set up I just don't think we're going to do the full thing in one session so heads up on that um hey precious good to see you um checking anything else yeah the the comment thing on LinkedIn is just kind of weird um I don't know I don't know why it works that way but that is how the live chat seems to to work sometimes it doesn't I've seen before where people are leaving comments on LinkedIn and sometimes it just does not carry over but I think so far uh it is with every single one of them because I have LinkedIn open on a tab here and can see the comments directly so usually I I have Instagram showing there so that I can see the Instagram chat but but I'm not streaming to Instagram cuz a vertical video is uh not conducive for this kind of thing but MJ yes of course I'm happy to do this so hopefully this isn't too frustrating but I feel like it's probably time we'll jump over so I'll put the link to this as well this is what I'm going to be trying to use today so Roy uh this this is going to be every live stream I do every single one of them is available on YouTube um so if it's streaming to other platforms like uh so this is going to LinkedIn for example to to Twitter or x uh I think it saves them there too so literally any platform that you're watching this on YouTube especially because that's where you're chatting from it's absolutely safe to YouTube uh you can go through any of my live videos and they're all available there um so yeah no worries if you can't make these and you just want to watch them or you want to watch rewatch them later totally totally works hey lock good to see you did you also share the YouTube Etc links in your post would help um yeah I I don't know I didn't put the the YouTube link um so for folks that aren't totally familiar with like some of the social media algorithm stuff like if I put a link in a post basically LinkedIn will not give it Impressions um which is really frustrating but uh I just put it on I'll put it on the LinkedIn post directly um so one sec we'll just add that oh yes you can't press shift enter I just experienced that awesome thanks LinkedIn oh I can't even comment on my own stuff amazing LinkedIn just does not let me send comments so um I cannot add the YouTube live to that so I apologize but anyway um this is the sort of the blog engine that Steven has written um just to kind of scroll down we'll kind of look at it together here uh basic ideas the content creator writes their post and markdown language like this readme file so for folks that aren't familiar with markdown or you've heard of it you don't really know what it is if you're familiar with GitHub and how the readmes and stuff are written this itself like literally what's on my page right now is written in markdown so it's a a formatting thing that's pretty popular like I said WordPress itself does support uh writing post and markdown so it's uh it's not like it's new or anything like that so it's a pretty common way that people write uh Wiki Pages blog posts and things like that so and then it says the markdown will be translated into HTML and displayed it to the client this gives an easy entry to writing post with all the flexibility markdown has this also includes source code snippits highlighting is done via High light JS oh we have to use JavaScript I don't know might not be interested anymore I'm just kidding um and with the GitHub theme so cool um there's a little video that's been playing here so you can kind of see what's going on here this little clip just shows okay so there's the markdown again if you're not totally familiar with what markdown looks like you have the sort of the hash tags to to have the different levels of headers things like that so let's start going through a couple of these together we're reading the documentation I know it's crazy ouch cat cat's eating my feet stop buddy let go if you're just joining I have two special guests I mentioned veto and Vinnie veto is the one attacking my feet right now he was uh sleeping behind me and now he's decided that he's causing Mayhem and Vinnie is in stealth mode he's currently under the couch behind me and he will resurface later Vinnie is the fat cat he's awesome uh he's super cuddly but he's uh he's escaped under the couch for now he just likes to like be kind of weird so anyway hopefully veto doesn't actually destroy my fee but we'll see so authentication when it comes to authentication authorization we employ open ID connect okay pretty straightforward Prim primary benefit is uh open connect providers customizable dashboard yeah so open ID connect is pretty popular um I use so in my my own development for brand ghost which is a SAS that I'm building uh we use o zero so this is a pretty pretty standardized thing so that's not too scary for me um ouch beo you got to stop buddy stop let go oh my God this is a terrible idea one sec come on buddy let go my foot I can't put my foot down because he's trying to eat it could you share us your cat yeah so I'm not writing any code yet uh but I did put the link in the chat I will put it again here in case you're wondering but I'm just going to be downloading this I'm not even going to clone it from the repository I'm just going to literally download it because I'm hoping I don't have to change the code at all which would be nice and it'll have to be configuration changes and things like that but I'm hoping I don't have to really change the code uh when it comes to deploying it and stuff that might be a little bit different uh I don't think we're even going to get to deploying it today I just want to be able to run it locally man this cat is chaos one sec okay buddy so this is veto I want to say he's a good boy but not right this moment so we'll keep him there for a sec okay comments another thing I have comments on my current blog I don't find a lot of use in them um so traditionally and this maybe is just a WordPress thing but if you if I find if I have comments available on my blog probably and I'm not exaggerating when I say this like one out of every 5,000 comments is not spam so opening up comments on my blog is probably just a recipe for a pain in the butt um so on WordPress there are I think it's called called akismet which is like a Spam blocker for comments but like it kind of sucks the value like yeah it's great if people can comment on the blog post but um the value of it I feel like is is not even there so I'm not I'm probably not even going to enable comments oh veto come on man you got to stop um I'm probably not even going to enable comments just because historically it's been problematic um I have used discuss as a plug-in man like in 2013 when I had my blog first starting up um I use discuss uh I haven't heard of this one uh Jas interesting yeah but I'm probably not even going to enable comments for what it's worth storage provider is an interesting one um I think oh interesting I was going to say um I might I was going to just go go with SQL light for today so I could see and I might still I might go with SQL light locally just to see it running and then have like kind of see how I'm going to be storing stuff because again part of what's going to have to happen is I need to take all of my my posts from WordPress which is going to be in a mySQL database I need to be able to take those transform them properly and then insert them into whatever database I'm going to be using in production it's probably going to be my SQL again um I don't use SQL Server um I'm not going to be using SQL light in production but maybe just start things off locally just so I don't have to go run a server I might just do that um so this seems pretty straightforward you're going to have to mess around dates with sqlite yeah that's funny you mention that yeah I spent um the company I worked at before Oh V stop company I worked out before Microsoft we uh it was a digital forensics company and we stored everything in SQL light and uh some people don't know this but sqlite does not have first class like date time types so you either store it as a number or a string and it's just kind of interesting so um hi veto yes I see you now he's climbing up there's there's veto you going to hang out here okay he's going to sit on my lap and lick my arm until there's no skin left thank you buddy Okay so so yeah I'm going to start off with sqlite I think just to keep it simple and then this is the other thing I was kind of interested in so again for people that write blogs um like one of the goals usually is like you want to have your blog be discoverable so search engine optimization is very important um I think one of the reasons probably why my WordPress blog is getting nuked right now uh with the whole CPU usage and stuff spiking out of controls I think I'm probably using a plugin that's trying to analyze some of the site and the people that wrote the plugin just suck um and I can't I don't know I'm not going to go debug someone else's plugin so there's a whole bunch of stuff that I'm going to want to make sure that when I bring it over uh I want to see what I get kind of for free in this blog engine and if I don't get it for free how do I make sure that I have a way to add it so for example um you can use different tag and stuff on your post to be able to have Google uh show different types of results like not going to be relevant for my type of blog but if you were a food and recipe blogger you might have noticed on Google if you search for recipe sometimes you'll see special results called out with like cards and things like that and you can see like the recipe inside of Google and that's because it's just using special tags in your blog post uh the same thing actually does work with videos you can have vide search results get pulled out um so that might be an option and like I've had people say that you know they'll search my videos or they'll search a topic and they'll see my videos and stuff come up from my blog so um I want to make sure that if I don't get that for free by using this and I suspect I probably don't I just want to make sure that if when I'm importing stuff that still holds true or else my my rankings and stuff will get uh killed off not not the end of the world if I can rebuild it but at the same time there's that to think about and then the other thing is as I'm writing new posts how do I make sure that like what am I going to have to do manually because I'm going to want to automate anything that's manual so um for the hey Rob good to see you um and will I do the DB data transfer process in live I probably will um I just don't think it's going to be today cuz I want to do some Exploration with this code so I think at this point we've gone through the docks um I probably should reopen the storage provider one um and probably download this stuff so we haven't even downloaded it yet like I said I'm just going to be uh downloading it I'm not going to clone it um not yet at least and the reason for that is I just want to muck around right now and then we'll we'll see the goal is to to not have to change code but um odds are we're going to have to change some code at at some point so let's uh let's see what's up let's get this pulled over uh okay I'm just going to take this folder sorry it's going to be tiny because I'm on a 4K resolution and what's being presented to you is just one corner of my screen so uh let me get that on my desktop and then we'll get it opened in visual studio and see what's happening and veto is done with sitting on my lap which means he's ready for feed again so why not download the release code uh probably just because I want to be working on whatever's latest to try it out but let's see where that Branch from oh uh cero 89 yep I do have a newsletter it is week it is here and one of the interesting things I actually one sec let me see if if it if the caching hit um on my computer so I just want to show you oh it did okay this worked I want to give you an example of why my WordPress blog is a huge pain in the butt right now so um this is my site and this is all on WordPress uh depending on what platform and stuff you're on like I've noticed no that the caching on my phone makes it so the top menu doesn't show I got popups and stuff there we go um so when I'm on my phone most of these are gone like I lose the home button I think I get an ebooks link and courses so if I am on the courses page let me click it and go there what H and look the the weird background stuff like that styling it's not like that it's like it's the CSS is broken so something's weird in the theme and it's the result of minimization and caching that's doing this but when I'm on this page on my phone I don't have a home button I'm stuck here forever which is kind of weird the other thing that I wanted to call out is like see the Gap in these pictures this is also a result of a caching problem so if I go clear the cache on my website all of a sudden the Gap here is reduced don't know why just is that way and then periodically it goes back to looking like this which is ridiculous um I'm on the 64th issue of my blog right or my my newsletter right now and for context I host like I have the original copy of my newsletter always on my website and then I I cross poost the substack and I do that because I want to own my own content and that way if substack ever is fix fishy or I want to switch away from it I have all of my own content uh owned so all of my blog or my newsletter articles once they go live on my website they're automatically paywalled but on substack there's like a month of time that you can go back and read them so um what I noticed today on my phone for example again this is this morning on the same internet connection I have just on my phone uh newsletter article 64 didn't show up and 63 didn't show up so the only new the latest newsletter article was 62 from September 21st so like like people if I were still posting I was doing almost one blog post a day at one point earlier this year and what people like they're just not going to show up for people like it's not okay so everything about my WordPress setup I really don't like um but like I was saying earlier these other pages that I have here like this newsletter tab right this is just a write up about the newsletter but this isn't a blog post by the way this is a good plug I do have courses available at CP but yeah like this page I don't know if I'm going to be able to do this kind of thing with a Steven blog engine and have landing pages like this so we'll see but um let's see what we got here again sorry the font I know is going to be ridiculous I apologize uh but we'll go in here we got a solution oh the font was so small I couldn't even see let me dock this come on windows isn't giving me the the icons okay so sorry it's going to be hard to read he has it broken into uh three projects here domain infrastructure and web um so if we go open the domain one this is just going to be like uh you can see even it says entities on it I'll zoom in so maybe a little bit out for us but so these are going to be the the different sort of data transfer objects or the entities that we can work with for a blog post title short description um are there maybe I should ask in the chat are any of you considering writing a Blog and you haven't done it before like it's a New Concept for you so I'd be curious to hear if you're like hey this seems interesting I've never written a Blog before uh do any of you have blogs um I'm just trying to maybe get a feel if you're willing to type in the chat like kind of you know your your current level of knowledge on this stuff um CU if there's questions you have about what you're seeing here I can explain a little bit more like short description for example is like probably means like meta description which is going to be the little blurb that you'll see on search engines so if you don't have it usually what will happen is it'll take the first X number of of characters and drop it in but you have this opportunity to write a short description which can be more SEO optimized so you can uh get some good keywords in there and stuff like that to make sure that uh people when they see it in search results they know what your content about and it's being indexed because it has good keywords in it um Paul shell absolutely curious for Years yet never have uh never written cool okay yeah great like honestly like uh maybe just to pause for a second this is sort of outside of um the scope of this but I I started my my whole Dev leader brand in 2013 and it was just my blog and I only started blogging because when I was put into a management position pretty early on uh it had been a little bit and I said like it's probably time like I I put some effort into learning how to be a manager and I wanted to do the whole um like learn in public kind of thing so I figured if other people are going through this like I might as well like write what I'm learning about so Dev leader started off as a blog like purely focused around like I'm transitioning from an individual contributor to a manager and I still have to in my role before I still had to balance um like individual contribution I was still coding with managing so I wanted to write just to be able to share that kind of stuff but I stopped a few months after because I was like oh like no one no one reads my blog like what's what's the point of writing it if no one reads it right um but in at the end of 2022 like over the holidays I said so that's like literally a decade later for what it's worth I said starting 2023 I'm going to be publishing content like non-stop so it's been almost 2 years of that now and if you follow me on social media hopefully it's obvious I post content as much as physically possible um cool in the chat didn't know you could write default uh for string.empty yeah pretty cool um I guess if we do this without the exclamation mark is it going to be the same thing looks like yeah so kind of interesting I was curious if it was going to think that it was inable string otherwise uh level of knowledge you never heard of this before this is a this is coding a Blog yeah so Aron um the context and this is for anyone else that's kind of joining the stream um oh spaghetti in Visual Studio thinks it's nullable interesting yeah like I took it off but it's not giving me a warning and I would think that it would anyway um so Aaron and anyone else joining uh um this is basically a uh Blazer blog engine so I'm going to be migrating my WordPress blog over to Blazer uh this is a Blog engine by step gel I again I'm sorry if I'm pronouncing his name incorrectly um Robert I don't think that any of this is in net 9 because I don't have net 9 installed um so I hope not uh if we scroll down a little bit lower like this is some new taxs for collection initialization you'll see so there's an ey list of tags here um and a pretty common practice maybe not as common as it probably should be uh working with null collections is a pain in the butt and you'll notice that the way might not be obvious but the way that this works here this is going to be a tags collection on this uh on this record type this entity that we're working with it's a private Setter so no one else outside of this class can set it and it's immediately initialized to an empty collection so again this is helping prevent us from having a nullable collection because if you have nullable collections sort of like by default you need to be checking if it's null before you use it every time and if you just assume that it can't be null because you're never setting it to null and you practice never setting collections to null you can clean up a lot of code so just a heads up probably just probably just above my pay grade nonsense Robert nonsense the more that we're exposed to these different types of things the the the more we learn so there's going to be a bunch of new stuff in here for me so and I've been programming in net and stuff uh I don't know for a good while now uh over a decade easily maybe not quite two decades but so generate slug interesting I wonder if this is configurable so again for people that haven't written blogs before the slug is going to be sort of the the the link for your article right and there's different ways to do this um I'm just scrolling down a little bit lower so usually like what you'll WordPress has this very configurable you can have the date and time prefixed and then you get like an article slug I don't know what's if slug stands for something or what it's short form for so if you are a Blog expert or just a webpage expert what does what does slug actually mean I know what it is but what does it actually mean I could go Google it right now but if you know in chat chime in because it's a funny word and I've never actually thought about like why is it called a slug um but anyway this generates the slug for us it will normalize the title it's going to look for uh special characters for us trim things out so cleans it all up so basically it's going to make sure that it's um compatible to be what we would expect as a slug in a URL so that's interesting uh folks this is a new a newish type of thing uh you might not be familiar with and I did make a video on this before I think it's super interesting so let me let me pause on this for a sec I know we're we're not even at the part where we're running the blog yet but I just want to show you this quickly um if we take this Rex why is my auto complete busted that's so weird you can see co-pilots trying to complete it for me but my uh my auto my intella sense is busted interesting I wonder if it like I wonder if it blocked the files when I downloaded it in a zip file from the internet kind of weird but you'll you might not be able to tell I'm hovering my cursor over this Rex keyword this type and it's not showing me the intell a sense which is annoying uh maybe I need to build it maybe there's something weird oh it Robert it is [Laughter] net9 crazy I don't I'm curious what you saw that was net 9 because I haven't seen any syntax uh oh you you tried this maybe okay anyway um what I wanted to show you is like this is the sort of traditional way that we would go build regular expressions and also there's this way um so you can just say Rex if you wanted to do this you could just match right so you could take this pattern you can actually take this whole thing uh I can't see I can't remember the order of the of the parameters but it might be something like your input that you want to match on than the pattern or these might be flipped around this is the problem when you're a c developer and you rely on intelligence too much but you can either declare it like this uh and actually you wouldn't put this into the static one but um or you can do matching with this static variation if you have this cached this is the most performant way that you could do it but they introduced this super cool thing with Source generators which is this version down here if you're not familiar with Source generators it's a pretty Advanced thing like um I I know what Source generators are I have still never written one in my life I've never debugged one in my life I just use the output of source generators all the time so this Source generator here right if you notice this is the same pattern that's up here there are situations where when you run this what I guess what this code will do is with the source generator it literally gives you a file that is Source generated so it writes out the code for this regular expression which means that at runtime you can actually debug the regular expression which is super cool because if you're like I mean for me I use chat GPT a lot for regular Expressions uh Rex hero online to test them out but you could go debug your regular expression now and see what's happening so it literally generates source code and it puts comments and stuff in it's not like um it's not like it's hacked together and you're like what the heck is going on here it's a regular expression so it's kind of weird but point is that they do that and there are circumstances where because it's generated code it's actually significantly faster so um if you can opt for this it can unlock a bunch of things but sort of the the default case when it's not optimized is that it will behave just like this one that I have highlighted as long as you're caching this regular expression being uh compiled now I think that there's limitations to how many of these compiled regular Expressions you can have I know proba like 6 years ago that was the case maybe it's different now though but anyway this is a really cool thing if you're not using it yet uh look into it because you might get some optimizations out of it I never seen that can you show what yeah I I have a video um on my channel one sec let me see if I can just pull it up um I I can't run this right now cuz I don't have net 9 installed so I didn't even think about that before starting this I might be able to retargeted to eight I don't know if something else is going to I don't know if he's using features that are are not so let me just do this super quick um maybe that'll build now let's we'll see it's doing something maybe there's some nou get package dependencies maybe we'll get lucky thanks spaghetti developers yep those are the docs um oh I missed one oh test package oh okay so now I'm going to run into this issue with um with Nate packages again I might be able to downgrade them for the point of this discussion it might be worth me trying to just get through this uh I'm going to where are the tests there they are I'm just going to unload the test uh there's a an inside joke there with some of the guys I work with that uh one of the guys he's he's actually he is a good developer but um he's early on when we were working together he took a a product management role and it was funny cuz when he would code with us and stuff uh he's really good at getting things like working like very good at it he he likes to say about himself that he's like you know he's not the best programmer and stuff anymore but we always joke because like to get things done he would be like the tests are in my way so he would just unload the test projects code up a bunch of stuff get it working and he knows that he's supposed to turn the tests back on and get things tested but sometimes he would just forget so that's our inside joke with him and I felt kind of dirty when I just unloaded all of these but it's for for a good cause um clean and rebuild um download the release version yeah is the release version onnut 8 maybe that's what I should have done in hindsight but um yeah maybe let me have a poke at that where's my window let's go back here so does it say what it's on I don't know we'll find out oh it's blog eight yeah okay and it say well V8 I don't know if that's for net 8 but is it coincidence is it is it true we'll find out if I don't have to go reconfiguring all the the projects why is my head red what's going on with that is just a light weird uh okay let's see maybe this one will build right away and by the way this is like what you're watching is like real this is how I mess around with stuff it's not going to be smooth ever um I fully expect this kind of thing to happen uh is I don't want to use there's probably a Docker config but whatever for now let's see can we build it sorry 2,000 times if not dangerous Z hey Douglas good to see you it's building it's doing something we might I might just close the other solution instance a spoiler alert this is the uh the Youtube video that's going to be going out on iteration and recursion but we'll come back to that another time did it finish build complete oh nice okay so we did it um the other On's closed off thanks to the recommendation yes the release one looks like it's on net 8 um but that's a good reminder for me I should probably get net 9 downloaded um okay where were we at we were checking out the domain so we spent a lot of time scrolling through this guy let me make sure that I get this position and stuff so you guys can see a little better we're talking about these regular expressions and spaghetti developer put in the chat the link to the source generators for regular Expressions again super powerful uh this is the Constructor for a blog post there is some guard Clauses here so can't schedule publish date if the blog post is already published so some like I said some guards updating again some guards cool okay pretty simple stuff though these are like everything in this folder is like sort of these domain models right so he has a base class it's an entity so every one of these things that I'm jumping between you'll see inherits from entity so everything is just going to have an ID interesting um sorry let me go back at blog post record so off the top of my head a blog post seems like it's the entire blog post did we have the markdown oh the content yeah so this is the actual body of the blog post and blog post record interesting naming I wonder if this is like a almost like a a list item or something but that doesn't even make sense because you would have probably have a title and stuff so I don't know how blog post record gets used kind of in but we can see we can go look for all the places it's used right so we could check that out later uh enumeration so this is a generic um this syntax gets a little bit wild let me zoom out so you can kind of see more of it uh this is the kind of thing that probably a lot of us don't write very often so it's a custom enumeration type here very interesting Frozen sets so there's this concept of Frozen collections that are pretty new and the Frozen collections are are truly like immutable and I will explain this briefly for just a second here so we have things like I read only collection or I read only list they are a read only interface to a collection that collection itself can be mutable so to give you an example if I made a new list let me just put it here oops public void so if we had something in here right if I make a new list of integers and it's called ins perfect okay so this here what is it not like oh it's it's telling me it's unused yes thank you um this is mutable right I can go add right I can go add one two three to this now if you were to do this so you can do I know it's complaining because it's unused but you can sort of cast this and now you might say well hey look my read only ins it's it's immutable like this this view it's the same collection it's not copying it so this readon ins view is going to be immutable from your perspective but someone can still go modify the underlying collection with a Frozen collection these things are truly immutable so you create them they cannot be changed uh even like it kind of gets rid of this scenario so there's a little bit of extra overhead for creating them but um if you pay that penalty once and they're accessed a lot to be not only are they immutable but they're also optimized for reading so they are faster however if you were to create them and read them once kind of thing it might be a bad trade-off because there's a performance overhead for creating them so something to think about um okay so Noob question can you explain why in a simple way we should use Blazer advantages compared to Wordpress thanks for sure so there's a lot of bias here and I'm I like to acknowledge bias when whenever I can remember to do so because I don't like I don't want to share information and have people think that there's like only one way to do things so honestly for the average person that just wants to get a Blog put together WordPress is great I don't have like like I don't genuinely have issues with WordPress I have issues with WordPress in my current configuration and if I'm being honest with myself if I were to dial back every single plugin including all the stuff for protection and things like that probably wouldn't be so bad the other thing I forgot to mention earlier on is light sale with WordPress in my current configuration the the file permissions were so locked down that I can't properly update things which is a huge pain in the butt so like sometimes plugins will just fail to update and then I have to go look through the logs and it's like there isn't right access to this folder and I'm like I don't know why there isn't right access to this folder like it should have just been writable it's literally a plug-in folder for updating but something in light sale change the the Linux file permissions and I can't write to it so there's a lot of stuff like this where as as someone who is a programmer I'm like I get infuriated because I'm like I shouldn't have to deal with this but if you're going to make me deal with it and I don't have good tools that I'm comfortable with like I want to go switch to something that I'm comfortable with so if I can use something like Blazer um for context again if you're not totally familiar with blazer uh Blazer is really helpful for people like me who write in CP and.net and were not great with web frontends uh even if you are great with web front ends you might enjoy it but uh I feel like it's built for people like me who suck in the web front end and that way I can just use c um and familiar things to go build a front end to a website so again um it's not that WordPress is necessarily bad uh there's lots of other options too but in this case I wanted to use Blazer so that I I do have full control I legitimately did not consider using a net blog engine or a Blazer blog engine because I was hoping this time around that I could just get WordPress set up and not worry about it and it worked for a few months and then started to just be a pain in the butt the entire time after that so I'm at the point now where I want to be able to have full control over everything and that way when things are wrong I'm not like who which plug-in owner do I have to go chase down I can just open up the code and go change it I don't want to modify a plug-in owner's code or deal with their support um my problem is it with WordPress my computer doesn't like me using PHP to change anything yeah well I don't like using PHP ever so uh yeah uh and work just called going to rewatch it hopefully awesome cool thanks fake devx for coming by um I use command line to update WordPress plugins but that means WordPress cannot do it without insecure settings right yeah it's honestly I'm just at the point with WordPress where like I think my level of usage of it and especially I was mentioning earlier the SEO stuff like the built-in like if you just use vanilla WordPress it's probably fine um but it is very customizable with plugins and it only takes like I think I have probably one plugin honestly that's causing Havoc for everything else um then when you start having like you add plugins they slow things down so then you have to hyperfocus on optimization minimization caching and then those break behaviors because caching is like the hardest thing ever in software development so you just get into this like this Whirlwind of like you know you optimize one thing it creates 10 more problems so then you go to fix the 10 more problems and you do but now there's five other problems and you keep chasing them down so now my blog is running WordPress I just hate having it there uh because there's too many problems that come up regularly so cool and Andreas yeah hopefully this is a good video series I would love if it was just done in one day but that's not going to be the case unfortunately I ramble too much in the first place but I wanted to just explore what we got going on here um so I just double clicked this one that said skill because it seemed interesting because it's not an RPG but maybe that's for another day um but skill I wonder if this is like on kind of like a a profile page where you can indicate your skill level like if you have an author and you can have a say like I'm a c developer so I can list c as a skill and put a proficiency level maybe that's what this is um social cool so I can already tell the way this is set up um I'm probably going to want to see how Steven's done this this is the type of thing just from looking at it and I'm not Steven's a an excellent developer so when I go saying what I'm saying I don't want this to sound like I'm criticizing Stephen this is literally his blog engine it's awesome so I'm just trying to be I want to be careful about how I say things because I don't want them to come across as like condescending or like I know better uh because he's brilliant but when I see this kind of pattern like I can already tell and I'll kind of explain my thought process I see three different social media things they each take a URL and has linked account right has GitHub has Twitter account um I'm I use a lot of social media platforms and be I already see this pattern like it's repeated three times just right here so to give you an example I'm going to want this I'm going to want to add LinkedIn Facebook Instagram Tik Tok I'm going to want to add medium I'm going to want to add like the list goes on uh I use I use Pinterest I literally use every social media platform except Snapchat um unless people want disappearing code Snippets then maybe that's a thing I could do um so I use I use every platform and I'm going to want them all listed here and to kind of prove it to you give me one sec that's my newsletter see oh this lost the the title but where is so here across the bottom right so that thing that we were just looking at in the code this is threads by the way it doesn't have an icon and it looks like it's like bumped out kind of funny but anyway I forgot threads I have redit so these are all the things that I'm going to want to link there and if we jump back over not in here sorry my apologies if you go back over there's sort of three things hardcoded so I could continue the pattern right I could continue it and say okay like let's see like I could go do this and then rename them accordingly for the different social media platforms and then I have to go see where they're consumed and maybe honestly maybe that's the easiest way to get this thing going and maybe that's what I'll have to do it's I'll what I'm going to need to do is make a list maybe I should start that right now make a list of like where I'm going to need to make adjustments in the code because if that like that doesn't seem like a very scalable way to me it kind of sucks but it's not so bad otherwise I would need to go make these two things together into like its own type of object and then have a collection of them instead so just to just to give you a brief example um if we were to pull this out into a I don't know what we call it yet so give me one moment because I haven't thought it through so uh it would just be like account URL and has account okay so something like this oops I want get not bull maybe in a knit as well so instead of doing this I would do uh public I don't know his patterns that he has so I don't know if it was like I list and then he did I think it was something like this that he had in the other spot um oh what it didn't have the the generic pulled in so anyway oh he has a lot of rules in place it doesn't it doesn't let me use naming with three X's it's like no you need to do this okay I will use some lowercase x's in there uh and that should have been init not internal and it doesn't like that either because I'm missing a curly bre bra how am I missing a curly brace what am I not seeing here oh int my goodness I'm missing an eye literally missing my eyes I can't read properly so yeah this would be like personally how I would have liked to see this and that way I can add an unlimited number of social accounts but I like I said I haven't even seen how this is consumed yet I'm not trying to criticize Steven for it I know that he has reasons for everything he's doing but when I'm looking at this part of the code that's what I would have liked to see yeah thanks uh the I was missing oh there Ste Stephen's in the chat Hey Stephen the reason is that I needed icon so you might want to extend the domain object as well awesome K thank you awesome to see you here I appreciate it so um yeah for folks that are interested Steven is uh on LinkedIn he's in the chat so this is his engine so I don't know St and I missed when you might have joined but thanks so much for being here and this is super cool to go through so I think right now this is the first um first spot where I'm probably like I need to make some adjustments for my own needs but on the priority list it's going to be pretty low um so jumping over okay so there's something for presentations which would be cool um I'm not at the point yet in my sort of uh content creation where I'm speaking too much I've done one public speaking event so far but this would be it's good to know that this kind of thing is like a built-in entity to use and then user records Stephen I had a question um and again you you don't have to answer anything if you don't want to I'm not trying to put you on the spot we have a couple examples of like blog post record and user record and I'm and I see like user record has URL click date clicked if I go back up blog post record has blog post ID the date click number of clicks um where like how do these get used because I see like there is a whole blog post entity right um but we have like this record and this other record here it seems like it's tracking uh maybe that's what it's for it's like tracking so just curious um how much time do you have I do have about another hour that I plan on streaming maybe a little bit less so but yeah I just wanted to start walking through this and seeing how things are set up so that I have an understanding of what's going on but so far this is pretty awesome the persistence part is where I'm curious I think um basically every click is recorded into user record okay awesome that's good so if I jump back here for folks because I had questions about um this guy and blog post as Steven saying they track um like when things are clicked it will just record the number of it so that's cool uh get some insights and Telemetry on that every and every 10 minutes aggre into blog post record oh very cool Okay cool so like I said earlier uh before Steven joined I was saying like what I should do to obviously and I'm going to have to do more in-depth on this is just find all references of it uh for me the best way to go understand the usage is to not look at the test tests for me are a really good way to understand the scenarios but I just want to know like high level where it gets used right and I think finding all references and then going through like the actual code and then seeing like okay where where does this thing get used is probably going to be a helpful way for me to understand what's going on and then like I said from there diving into tests and saying okay like what are these actual like scenarios that deserve some attention so um so Stephen saying for me I wanted to see how many blog posts are clicked per day yeah cool okay so you can see uh how often a Blog posters click for each day that system goes around the whole concurrency issue and lock stuff awesome okay no that's great I appreciate that thank you um just like literally from seeing the name and I was just noticing it was it had a count for oh sorry that's the URL this one here had the count um the only thing I could think of was I don't know like some some thing that we were counting with the blog post but I had not yet gotten as far as seeing the uh the usage and the code so very cool um persistence so I was saying that I was hoping to try and get some SQL stuff set up the production thing for me will be my SQL to get going I was thinking about just using SQL light so that's why I'm not looking at the other ones I find this is just personal preference I find that in memory stuff is like is convenient but um I think the problem is like it depends on the implementation of it right so if I check out this repository I've I found from my personal experience using something in memory can be great because you're like I don't need to go set up any databases even a sqlite file I don't have to worry about it but the problem that I find is like depending on the implementation of an inmemory provider what can happen is that there's such a level of separation between like how an actual database works and using like something that's dictionary backed or something like that like truly just a collection um something like link to cql uh a lot of people use this especially if you're using Entity framework right you have like link to SQL type Sy tax like you get different behavior when you're using inmemory collections versus not so if you're just doing something on a dictionary versus with a database there are some things in expression trees that cannot be mapped to SQL and if you're used to working with an in-memory databas or it's not even a database inmemory provider that's not a database then all of a sudden you switch over to a real database you might have a bunch of code that breaks because it's truly just not compatible with the database engine using so personally I find um and again this is just literally a personal preference for my experience I will only use inmemory stuff if it's backed by an in-memory actual database so like a in-memory sqlite database or something like that then I know at least I'm dealing with the um the Syntax for the database uh otherwise my personal preference is just just to jump right to sqlite because yeah it's going to be on disk but like it's it's very very simple to use if you've never used sqlite before um I think a lot of people they hear sqlite and especially because it has light in the name they're like that's not a real database um if you've worked with mobile phones um there's a lot of apps that exist for mobile phones and you'd be surprised but basically every single one of them on your phone is a sqlite database associated with it uh I know this from working digital forensics not from building tons of mobile apps but sqlite is a very popular database for so maybe not something like you want to use in a big distributed system but it's very capable it's it is very fast people are like oh it's you know because it's just a file on your computer it's going to be slow NOP it's very capable of holding Lots you can check out the sqlite documentation their website list outs a bunch of stats for it that are mindblowing like how big the database files can get because people are like you can't have like a gigabyte uh sqlite database you can have like very very large sqlite databases and they're still fine so it's a pretty interesting database technology um yeah and like even Steph saying right uh for a a Blog sqlite will be good enough for 90% of of cases it's literally just a file on the same computer you don't have to have a whole server running for it um I'm probably just going to stick with my SQL because I want to use like when I go to put this into production I want to be able to have it hosted I want to be able to take ADV of I was using AWS for a bunch of stuff um I'm going to probably use I'm moving a lot more things to Azure sorry my cat's attacking My Feet Again um and probably take advantage of things like replication and things like that just so I have a backup and never have to worry um I'm just going to go back and read some of Steven's comments so yes early I recorded more than just clicked on a blog post for example how many people clicked on about me cool um and shame on me I never renamed it um yeah and then Stephen saying very fair point as you said sqlite in memory is so much more convenient yeah so it's again I'm not I don't want to say this kind of stuff to tell people hey it's wrong if you go do an inmemory provider and it's just a dictionary or something like that it's not that it's wrong um it's just that I I have found in in multiple cases not just at Microsoft even at the company I worked at before at Magnet forensics where people get caught off guard where they're getting all of the benefit of this memory database for playing around and then they don't realize that there are some things that just don't transfer over to um like the Expressions don't transfer over to SQL so just a heads up yeah good good point Stephen so backing up a sqlite database is very easy you copy and you paste it it's just a file um the only time that can get a little bit weird and it's not so bad is like in the journaling mode so you can have a journaling mode for SQL light which is like a like a wall and shm file so instead of your sqlite database being one file it splits into three when it's open so there can be some weird things there where depending on your read and write access you need to copy those all three files what will happen the next time you connect to it on the copy is like it will replay the journal because the journal is sort of like the steps that need to go be applied to the database and when you connect to the new copy of it when you instantiate the action it's going to say oh I have to go I have to go apply this journal so it goes and does it for you so um just yeah I think Stephen's totally right working with sqlite for for blogs and stuff is probably for most people all you need um so it's it is a great option even if people don't think about it as like a first class kind of thing the only nice thing for you uh in memory zero setup yes collections are native to.net rapid prototyping yeah so this is excellent point from Stephen um I'm it's funny I'm highlighting the the text in the chat as I'm reading it I realize now you you guys can't see what I'm highlighting but um so as he said rapid prototyping it might be a reasonable Choice 100% agreed if you were just like I want to press play on this and see it work and you don't want to think about any files or anything else great go do it right if you're not if the things that you're trying to tackle in your prototype or what you're playing around with have literally nothing to do with the sequel side of things by all means um in every scenario that I was explaining where it was not a good choice is literally because people were focused on manipulating and reading data thinking that they were like hey I didn't have to go set up a postgress database or MySQL I didn't have to do anything I didn't even need a sqlite database it's just in memory and they're focused just on the reading and writing and that's where they get burnt by it so um it it is is totally a a fair option okay so in the mapping let's go check some of the things out here this is going to be for Entity framework core cool so max length required so some of the conditions and stuff that we have set up on our record types our entities so if we recall blog post right if I F12 on this remember we were looking at this earlier inside the domain folder so that I for for God it's not going to expand in the left nav here but I wanted to kind of show it so this blog post is the same one that we were on up here okay so this is just the mappings for n framework core so then it knows like which what's required there's going to be constraints on what can go in here so cool oh cool there's a preview image URL fallback that's handy let's see so all these yeah like it's in a mapping thing it's just going to be about Entity framework core mapping here so cool stuff this is the kind of thing like for me um I've I've made this pretty public before I don't like using Entity framework core but this might be a good opportunity for me to have something um to have something that's working with nty framework core by someone that knows what they're doing because what happens for me is every project I go to use it I'm like okay this time I'm using Entity framework core and then I start and I'm like I feel like I'm fighting against it and then I just go back to to using raw SQL and uh and Dapper usually and I just do it all myself but like I said having it in place already for me this is one of the best ways that I learn so to give you an example if I was working with Steven stuff here and I was like man I'm having a lot of issues I'm just making this up randomly I'm having a lot of issues because like I really need my profile information to have just like like why why is it limited to 512 like I can see like where to do that how to change it and then if I were like oh actually um I noticed that there's a weird bug and the sort order can have some weird constraints like now I go oh I wonder if I can add in at The Entity framework core level some other constraints on the sword order like by seeing examples of other things for me that helps so much in going oh I am able to do something like this like it's it's almost like it inspires some ways to approach things so um having something working I think this will be a cool opportunity for me to not be like avoiding enti framework core cuz I don't think there's anything wrong with it I just find that I'm always fighting against it when I'm setting it up so this could be great um oh awesome thanks yeah Steve um I appreciate the feedback um and thanks to LinkedIn LinkedIn can only handle JPEG and PNG files ah but I wanted to use avif and webp for thumbnails as well yeah so good I should have asked this um I and I don't I haven't gone far enough in your code I'm assuming that there's nothing built in that will let us basically provide an image and then have it automatically compressed that's not a big deal because even on WordPress I was trying to find plugins that would do it and they would convert but what would happen was like like they would convert a a PNG or a jpeg into a webp file and it wouldn't even be compressed and then I go on to the site I use is cloud convert and it does an amazing job with compression so um I have been manually doing it if there's a built-in thing that would be kind of cool if not I will keep doing it manually until I get frustrated and say maybe I can build something into um into this if there's an option for it so um something I'm kind of curious about the not until now I wanted to integrate Azure blob storage but never did this until now cool okay no that's cool so we have the DB context here uh again for folks that aren't totally familiar I'm not speaking uh about this as an expert because I've already told you I don't use ntity framework core a lot but the database context the Stevie context is going to be sort of like the primary way that we're interfacing with our database so you can see that um all of these DB sets as public properties on here these are going to be the different types of entities that we can go work with so if we want to go uh interact with blog posts we would have an instance of this blog DB context then we can ask for the blog posts and then manipulate them and read them and stuff like that so um what's really cool about Entity framework core is that you don't need to be thinking about writing SQL right you just go like if I go find where where this is used as an example um should say blog post okay how much SQL do you see written here the answer is zero and it's because all of it's done through Entity framework core so um like this line 40 blog post has no tracking so uh this part is maybe a little bit more advanced but there's some optimizations where you can turn off tracking and that way you get some performance improvements uh depending on what you're doing so we're basically asking like this is going to find the blog post that has a particular ID so find one of them or it's going to give you a null back if there isn't one or default I'm assuming it's null in this case um but this is essentially doing a query and there's no sequel on the screen which is cool so for a lot of people this just lets you focus on working in the programming language that you're used to um the reason like I like explaining in a little bit more in depth why I don't like why nity framework core and I don't get along again it's not because I think that this is bad like this is great I can stay right and CP but my my challenge is is like when I think about databases I'm already thinking in SQL so I find that like for other people this is is probably amazing because you don't have to context switch like I'm writing C code what's the sequel for that for me when I'm accessing data like I'm either reading or writing it I'm like I'm thinking in SQL the structure of the table and everything so for me to to miss out on what that squl syntax looks like like this becomes actually more mental overhead for me which is kind of funny but I say this just to explain my current situation because this how my brain works but it's not going to get better unless I spend more time doing this which is like I said earlier another reason why I'm kind of excited about this is I'm going to be forced into using it which is not a bad thing in this case so very cool um what did I modify in here oh left that over cool okay uh page dat list query extensions I think we have a common in the code oh no right like you're not so code should be self-documenting I think this is a great great example of a comment so Stephen I'm assuming this was by Stephen I think there's a couple of other authors in the repository um but like he he's explaining like if you were to read this code without the comment maybe you're like hey look we should probably use two list async like that might be something you if you just had this code you'd say like we should do that and he's saying I tried it it performed poorly um and explained why and then links to a stack Overflow thing and this is like a nice guard for people that if you were coming across this code and you were like oh no man like obviously we should use toist a Sync here and I'm just going to go change it you would literally regress functionality in the code base it would become slower according to what Steven or whoever the author was for this particular bit of code so for everyone who's like comments on the code don't don't do it like I think you know anyone who's giving you hard and fast rules or never do something or always do something there's always some spot in the middle that's going to be okay so Steph saying even with Entity framework you'll hit certain walls quickly and it's sometimes hard to anticipate how the queer will perform the advantage here is I wrote code that works with sqlite SQL server and MySQL yeah so that's a good call out um where was it um oh I I kind of uh whatever I was looking at the test anyway but Stephen's got a really good point here if you like he was able to release this right and it's using Entity framework core and no one is tied to like he didn't say guess what you're stuck with sqlite I hope you like it he's he's written something using Entity framework core that allows you to swap out the database implementation now you as an individual you might not publish your blog and then go um and then I don't know like two weeks later say you know what like sqlite's been great but I want to go to mySQL try that out for two weeks and go oh you know that's been great but I want to go to Raven DB like it might not be you that's doing the switching but it's kind of like uh generic collections right like wrote wrote the code once and it's going to be compatible with a bunch of database engines so um that is one nice uh benefit of using Entity framework core for sure and when I write stuff in Dapper to give you an example of where this falls down it's like I build my own repository classes and then I will go write SQL queries ideally I'm not using like super unique functionality of that database engine but if I do what I would need to do is create a new repository instance and leverage that new repository for a different database engine so if I was using sqlite specific syntax in one repository I would just have to go recreate the repository for MySQL or for postgress or something like that uh is this engine from Steven open source yeah I believe so like I downloaded the code I didn't see what the licensing was Steven's on the chat right now and could tell you but I am pretty confident the license is totally open license what's it say says you owe Steven tons of money if you even look at this nope it says MIT so here we go so there you go it's uh totally free to use you should support Steph however you can because he's awesome okay cash repository what do we got going on here so this is an interesting pattern uh I like this a lot uh what do we call this this is like a decorator I guess so if we look the cash repository itself is an i repository type but you'll notice it also takes in an i repository it's Inception right so this is a decorator what we're able to do is take in a repository and then we we decorate it or we put a wrapper class around it and then it has the same interface so what's cool is if you were using a repository somewhere this repository interface we jump over to it it has these different methods on it okay it's kind of like crud you have your your create get your your sort of like create read update delete kind of things going on some of them are in bulk what have you um but we have this interface now if you were already using that interface somewhere you could basically wrap that interface with a cash repository and it still meets the same interface so it's a direct drop in and supports caching which is really cool um I've personally use this in my failed SAS from a year and a bit ago I think it was called meal coach so all of the repositories we had had like a an optional sort of caching layer around them um which was super handy because you could basically avoid tons of database access if you didn't need to do it and the nice thing was that it had the same interface right you could just wrap it and then you get cashing for free so that's super cool um cool let's see anything else in here the the IM memory cache oh and this is the built-in uhet stuff for the memory cache awesome I wonder can we see where it's used that's in the test but here is this is going to be in the um what's it called the dependency container extensions right so these I'll see where this is called just so I can show you first Oh no I got to find the calling spot it's probably right at the entry point though so sorry for jumping around folks give me one sec uh okay so configure app Stephen might be able to tell me much faster but um you can even see like on the services like add razor Pages add server side Blazer add signal R um these are all things that are going to oh I think it's right here um these are going to configure your dependency injection container okay so what this I'm I'm trying to re like uh figure out I don't know from anyone who's watching this right you you might be very familiar with dependency injection you might not be but a heads up when we're constructing objects in C and this is the same thing in other languages a lot of the time a pattern that we we strive for is Constructor parameter passing so that means that if you have dependencies for the class you're working with that you can pass those in when you're constructing something and this is inverse to inside of a Constructor newing up a dependency and the reason that you do this is that you allow other people you're inverting the control here you're allowing other people to tell you use this dependency like you don't need to know the implementation you just need to know the contract that you're working with so we pass things in through the Constructor and this is a common pattern we do but one of the s effects of this is that when you take it to an extreme this program.cs file like your entry point what ends up happening is that you have like thousands of lines of code that are just like creating instances of objects and passing them in and it's like you basically made the rest of your code nice and clean but you have this one spot that's just like an absolute nightmare to look at so dependency injection containers basically work around this problem they say look you don't have to go write all of this code to go new up all these objects you can uh it's it almost feels like magic you use the container and you say I need this object and it goes no problem what parameters have to get configured on it let me go find those okay which parameters do those things need let me go find those and it basically does all of the work for you behind the scenes you just ask for what you need and IT wires it all up for you so I think this ad storage provider um this is the one that we were just looking at right so I'm going to jump back one more time you can see that this is an extension method that Steven added and it's going to take in the configuration that we have for our application if I jump into this this extension method will check based on the configuration what one we're working with so again if you're confused by that the configuration if we jump over to this here on line 22 I'm I'm just my eyes jump to this line just I haven't even read anything we can see that there's a persistence provider this one says in memory so again let's jump back I happen to get very lucky and line 20 here is checking that uh you know in the configuration for persistence provider this one says if it's in memory go set up things this way okay so it will say use in memory as storage provider and then register cash repository right that's going to use that decorator pattern we were just talking about so it will go basically create a new cash repository and pass in the repository that you want to be decorating and then also gives it the in memory cash so pretty cool uh welcome from bod awesome that you could make it and uh air um I don't know where burhan is um he was on the stream last night I I don't know what time it is uh where he's at but I assume it's a maybe it's a inconvenient time of day or something but he's uh he's been a great supporter okay um I know I jumped around a lot it's funny I'm coming up probably on the end of the stream I didn't even run this thing yet maybe we should see if it runs um no pressure on Stephen I don't know if it runs out of the box but I think it probably does considering it's configured within memory um but let's try it I don't I think he we have to do some minimum amount of configuration but we'll see it'd be kind of cool if it does just run a i in show folks oh is there no startup URL okay so it's running somewhere this one's I'm trying to read https is what I want Let Me Go go ahead and open it in a new browser oh look at that look at that that is super snazzy there you go Stephen I have no post obviously right um this is the homepage the archive about me I'm probably going to keep that picture um oh we didn't even talk about RSS feeds um that's fine though um color mode oh wow but this is cool right we were talking about this when we were going through some of the entities right so this is sort of the on the about me part we have like a an author profile we looked at the skills remember we saw that uh and then we had the talks um we looked at that sort of entity type as well so this is pretty cool um obviously I don't have anything configured so there's not going to be anything that shows up here but this is super awesome search oh man look at that search like it flies out that's got to be some that's got to be some JavaScript magic right we can't do that in in C that's way too fancy um no this is this is cool and it's it's very um responsive right if I don't have any blog posts but so I I'm pretty excited about this um I think what I'm going to do maybe this will be a good sort of thing for the next time sorry folks that I didn't get maybe as far as I would have wanted to but I think next time what will be a good exercise is um I can go like together we can just go make some dummy blog posts we'll set it up with sqlite and then we can go look at the format of those blog posts um now in that same next slide stream what we can probably do together is I can I'll maybe do a little bit of homework and I'll see if I can make sure I can get a connection to my to my mySQL database that has my existing blog post and we can compare the schemas and then we can talk about what I will need like I don't think I'll code that in one uh live stream as well but we can talk about here's the format we need to get to and here's the existing format like what the heck's got to happen right so we can talk through that and um that's probably going to be an example where um and this is like it's no fault of Stevens or anyone else's but there's probably going to be a bunch of gaps in terms of things where I was like oh man like I was using a plugin for this and I need that or when I say need like I want that capability right so um to give you an example like uh and I don't expect this or anything but I was able to have like an automatic table of contents probably not getting that for free I was able to have um what do they call them like short codes where I could basically um automatically drop in like pieces of content from a library so I could put in like course advertisements into a post and not have to recreate them every time so there's probably going to be a whole bunch of stuff like this that like I said I don't anticipate stepen has it done it's obviously like not a shortcoming of any of his work nothing like that but this might even be stuff where um if it makes sense to Stephen if I need it maybe I can go build it or we could build it on stream or something um and then and see like if we can put a poll request up or even just you know see the idea doesn't mean like the code has to be taken and and thanks Steve no I appreciate you being here um even if it's not something that he wants to take into the repository like that's that's totally okay like we can Fork it we can do whatever it's no big deal but um obviously he's laid so much of the groundwork here that's going to be awesome so maybe the next stream what we'll do then is we will let me get back to my my full cam um we'll try to do that comparison with the database schemas and we can try to see what we need to build in terms of a migrator because my gut tells me that we'll be able to write a migrator that does like 75% of the work and as long as I have a good understanding of what needs to manually be done what I can start doing is run the migration and then just chip away at the post but the the earlier on I know what types of things need to be done by hand the more I can say okay wait if there's 350 posts do I want to do this 350 times or should I spend a couple hours write some type of Automation and that's going to save me in the long run so I'll have to see but maybe that'll be for next time but yeah I hope I hope this was helpful sorry like I said I know there wasn't that much code uh that we got to dive into we kind of went across the repository a little bit the um if you joined later I just want to make sure I can share the um the link back so you guys can check it out um if it wasn't obvious like I downloaded the release and basically in visual studio if you just press F5 you have a Blog engine that runs locally which is nuts um super cool he's done a really good job on it uh this is the link to it I just put it back in the chat so you can check that out and um yeah I think that's probably a plan for next time so thanks for for checking this out if you like I said if you are getting started trying to write a blog um is is using Blazer and.net the best option for you like Maybe not maybe using Wordpress or something else is totally fine for you um I'm I mentioned earlier in the Stream I'm at the point where uh my goal was that my blog should be very hands-off I shouldn't have to worry about it but I I basically have to worry about it every other day like I already woke like I woke up this morning to alarms on my blog and I'm going okay do I have to you know like restart the whole uh virtual machine like it's just it's such a pain right now so if I have full control at least then I don't have to worry about stuff um and that means if I don't get plugin access and stuff like that guess what we got more stuff to build and that's okay too so thanks folks for checking this out um I will try to do this again next Tuesday same time um and yeah I I appreciate you all being here so we will

Frequently Asked Questions

What is the main reason for migrating from WordPress to Blazor?

I'm migrating from WordPress to Blazor primarily because my current WordPress setup is crashing every few days due to high CPU usage, likely caused by a problematic plugin. I want more control over my blog and to avoid the constant maintenance issues that come with WordPress.

Will the migration process be completed in one live stream?

I don't expect to complete the entire migration process in one session. My goal for this stream is to get familiar with the Blazor blog engine and to start the migration, but I anticipate that it will take multiple sessions to fully migrate my blog.

How will I handle the formatting differences between WordPress and the new Blazor blog engine?

I plan to investigate the format of my existing WordPress posts and compare them to the new Blazor blog engine's requirements. I may need to write a bulk converter to facilitate the migration of posts, especially since WordPress uses HTML while the Blazor engine uses Markdown.

These FAQs were generated by AI from the video transcript.
An error has occurred. This application may no longer respond until reloaded. Reload