All .NET Stack All The Time - .NET 212

Caleb recently started a new job. The project he is working on is all in .NET (MVC, Web Api, Azure, etc.). Caleb and Shawn discuss some of the features of MVC and Power BI that Caleb is learning on the fly. Join us for a quick episode all about .NET

Hosted by:

Show Notes

Caleb recently started a new job. The project he is working on is all in .NET (MVC, Web Api, Azure, etc.). Caleb and Shawn discuss some of the features of MVC and Power BI that Caleb is learning on the fly. Join us for a quick episode all about .NET

Picks

Transcript


Hello, and welcome to another episode of medjinterson.net. I'm Sean Klubbe, your host. And with me today is Caleb Wells. Hey, y'all. How's it going?

Hey, y'all. So it's just you and I. Yeah. Hey. That right.

The the the original 2 Amigos. It's been a fun ride so far. I think so. I mean, we're a little past a year when we first started. Yeah.

I think, you know, the we're getting more listeners. So thanks to all the people that are out there. It's doing great. We hope that you're enjoying the show, and, you know, keep up the listening, spread the word, and give us feedback. Yeah.

Absolutely. So what do you wanna cover today? It's just you and me. We don't have a guest. What do you wanna talk about?

So figured we could talk a little bit about my new job, not the company or the the clients, but the code. Right? I have come into fairly well developed application. They've been working on it for maybe 9 months or something like that, but everything is in dot net, right, which is our wheelhouse. And it's all MVC.

You know? It's all Azure. And some of the stuff is, you know, stuff that I haven't worked with in a while or worked with at all. So it's been it's been interesting to to kinda come back into this realm where front end, middleware, back end, the whole deal is is all, Microsoft products. So the entire stack, No no front end framework, JavaScript framework, or anything like that?

No. Angular view? No. Well, not not in this project. Well, we'll we'll see going down the road there.

Company work forward, they're they're honestly they're pretty technology agnostic. And so, you know, I've been told that, you know, if another project comes along and I move to that, I I can choose. But this one, they just chose to stick with, I guess, Microsoft because they're using a lot of the Azure data analytics and data storage stuff. So they're using data lake and Power BI and some Synaptics stuff, a bunch of stuff that I'm still digging into and learning. But the application, you know, is your typical class libraries, an MVC web app, and then a Blazor admin app, which which I figured you would you'd get kick out of.

Yeah. Client side or server side Blazor? Server side. Okay. But, yeah, you know, like like I said, they're they're pretty like, you know, hey.

If you can get to work and and or any problems, you can use whatever tech you want. How are they handling state on the the admin? I guess since it's admin, it's not such a big deal if that's It's not. It's not. Out a change, reset, doesn't have have any issues.

Okay? Right. Up until this last sprint, admin was only accessible by people at my company, not any of the client users. I actually spent this sprint changing that to set up permissions and access because they wanna start letting some of their users into the admin site. But, again, like you said, it's not it's not public facing, so that that's not not such a big concern.

But I thought we could talk a little bit about MVC. And I don't, you know, I don't know how significant these changes are in the past year. And for people who have been using it all along, they may not be big changes at all. But one of the things that I found really interesting is the razor pages, right, which is not it's not the original way in MVC, right, which you've got separate classes and then separate HTML views, right, with razor in them. It's not blazer, right, which has got all of kind of a mishmash inside of their own files.

This is very similar to the old school code behind, right, where you have a c s HTML, and then you have a little arrow, and you click the arrow, and you get the code behind. Right? Which at first, it seems like maybe you're taking a step back. But once you start using it, it's really not the case. And one of the nice things is, right, they're both there in the same place, easy easily accessible.

So but, you know, dig into that, and that's been it's it's been interesting, but it's been good. You know? It's it definitely brings back memories. So it's all done it's all dot net Core? Yep.

Yep. All dot net Core. K. Yeah. 3.1?

Yes. 3.1. Okay. Right. Alright.

Are they, looking forward to dotnet 5 coming out next month? I don't know that they're they're all that concerned about it, really. I'm looking forward to it. I think it'll be it'll be good. I don't know if this project will be transitioned, and if it is, when.

It's definitely kind of in in a state of flux where we're having to add a lot of features and build on it and then go back and refactor the stuff we do wrong and the quirks and whatnot, but we'll see. I think dot net 5 is gonna be great, personally. Yeah. I see I've seen the betas coming out for dot net 5 and and meaning this to fire something up and just kinda poke around a little bit and see, you know, how does it feel different, or is it just kinda just a normal evolution of of dot net? Gotcha.

Right. Right. Well, hopefully, it won't feel that different. Yeah. Yeah.

Yeah. Because if it feels different, then maybe they did something wrong. Well, yeah. I mean, c sharp 9, things like that. Yeah.

So Yeah. Yeah. Yeah. But, you know, so I've been been digging into the razor pages and, you know, having to tweak startup files and environment variables and all that kind of stuff that that's, you know, ancillary, but takes up, you know, a day or 2, right, when you run into an issue. One of the other things that they're using fairly heavily is areas in MVC.

And I know areas have been around for a while now, years, maybe even before dotnetcore. I'm not not positive on that. But with this application, it's multitenant. Right? So our client is basically reselling this.

When they get a client of theirs come in, we add in the appropriate areas and and update the config files and spare everything up for this new tenant. Right? And that and that's a really a perfect use case for areas. Right? So I've never used areas.

Anyway, I've heard of them, but I do really don't know how they're used. So for our listeners, you know, tell us what what are areas and and, you know, what it is for. Yeah. So so right in MVC, you have your your index and your underscore layout page and your view imports and view star, all the all that stuff that combines to make a page in MVC. Right?

Areas is basically an extension of that, and and it sits on top of your your base setup and your base layout and your base index. Right? And so the way that we have it set up is you come into the website, you know, at the the base URL, and you're shown, you know, kind of the marketing selling stuff. Right? But if you update the subdomain on the URL for one of our tenants, then we've got it set up to where it will actually go look in the areas for the the tenant folder in the areas for that tenant.

And inside of there, you have your own version of login partial, underscore layout, index, view imports. You don't have to. But in our case, the way that we've developed it, each tenant has their own wants their own look and feel. Right? And they they wanna have their own splash images and their own branding and all that.

And this is a a good use case for areas. Right? So you can have a 100, and you still have a base layout and base CSS that everything derives from, but you can then tweak it on a case by case basis. So areas are kind of a a way to organize everything and make everything that's grouped together kinda way for a encapsulation or separation of concerns, that kind of thing. Yeah.

Right. Right. Because we we don't want you to go to the website and get the look and feel and the info for one tenant on top of another. Right? And I'm sure there there are obviously other ways areas can be used, but I just found this to be an interesting way that they've approached the the multitenant aspect of this application.

So that that was another thing that, you know, I've dug into and picked up. One of the other interesting things that I'm having to do more of a deep dive into is Power BI. And Power BI is another Microsoft product. It it's kind of like, data analytics, right, on steroids. Right?

You you have users that go in, and they can pull information from database stores, and they can build charts and graphs and filters and and all this aggregation of data, which is really the big selling point of our application. This this application in particular actually started out tracking and managing COVID data for different hospitals or publicly accessible data that we pulled in, you know, and aggregated into one place and and were able to see some trends, you know, and and long term data modeling. Right? And Power BI works in a in a number of ways. But in order to provide it to end users or customers who don't necessarily have access to it without paying extra licenses, you have to jump through some hoops to embed it into a web page for the end user.

And they've got, you know, this long Wiki and a lot of documentation on it. They've even got a playground. But Power BI, I think, really is one of their newer offerings, right, like in just the last couple of years. And so it's continued to grow, and they're adding functionality, and things are changing. And, you know, you kinda have to work around some of the limitations.

So one of the interesting things that they've done is they're actually so they've created a partial that's used by all of these areas. And inside of that partial, it has an embed tag in it, which basically becomes an iframe. Right? But in order to populate that embed tag with the appropriate data based on tenant, right, and keep that that segregation, they've actually created a tag helper, which is a built in functionality in the VC, but it allows you to basically target certain elements and tell it what attributes to look for and how you're gonna be providing those attributes. And so what they've got set up is when you go to a tenant and you then log in and you're presented with a list of all the reports they have access to, when they click on one of them, it then starts this task process async, and it starts to build the view context for that page.

In in our case, it's building it, and then it's getting values out of the tag helper context and then pushing them into the view bag for that page, which is interesting. And then it's pulling those attributes out of the view bag and and pushing them into the embed, which then calls Power BI. And it says, okay. Yeah. You're legit, and it loads up the the associated report.

So I thought that was this is something I haven't dug into much and hadn't hadn't really seen used in this way, but it it's it works really well. It's it's it's honestly very it's a elegant way of doing it because, right, you have one tag helper class that is extending the Microsoft tag helper. You have one partial that's being reused among all of the areas, and then you just have to, you know, embed that partial in the appropriate page in these areas when you're off and running. So some cool stuff there. So this is all Azure.

Right? Yeah. All the Power BI stuff exists in Azure. Yeah. Everything for this application, is it Azure or is it a hybrid model?

No. Yeah. Everything's in Azure. Sorry. Yeah.

We have the admin app and the web app. There are apps running in Azure's services. Yeah. It's yeah. Locally, though, of course, I'm I'm, you know, testing on my machine.

One interesting thing that they've set up, though, and you just made me think of this, is this app also uses Cosmos DB a good bit, right, which is NoSQL. You know? That's just simplified as NoSQL. But we don't have a local developer, Cosmos, or SQL Server, or anything like that. They actually have it set up inside of Azure to use your local 127.zero.zero.one, but then use our staging keys and data, and Azure ties that all in.

So, locally, I can do an f five, spin up my dev, and have access to all the data in staging locally. Because if You're not using any of the emulators then? You're not using No. No. I don't know if it's something that's common in Azure, but it's something that my coworkers got up and running.

And it makes development so much simpler. Right? Because there's one less thing you have to worry about. It's all managed somewhere else. Right.

And the and the project that I'm using, we started out using Cosmos DB, and we switched over to using, blob storage really as the storage mechanism because it's blob storage is a lot cheaper than Cosmos. Yes. Right. But then we're we're using their emulators for doing local development work. Okay.

Yeah. If if you want, you and I can talk more about this offline. But I thought it was interesting. I was like, oh, that actually works. He's like, yeah.

Yeah. The only downside is we don't actually have and maybe it's not a downside. We don't have a dev environment for Cosmos or for Power BI for any of that stuff. We just have the staging and the production. And dev and staging use the staging.

And in our case, that actually works out well because, like you said, this stuff is expensive. You know? Tens of 1,000 of dollars a month depending on how you're using it. Yeah. Yeah.

It's yeah. It's my project. You know? They've they've got week 4 different environments, you know, devs, a test, a stage, and a production type type thing. And so we're really looking at, you know, what is the most efficient, you know, use, and that's why we went to you know, and we don't need that instant transaction ability that Cosmos DB has, that kind of load for the most part on for you know?

If something comes to that point, we'll switch and use part Cosmos DB. But just using blob storage Yeah. Ends up working out well for us. Good. Alright.

I guess a lot of it depends on the client too. Our client is not really concerned about money. Well, you know, as long as it's not a $100,000 a month, they're not concerned. It's good to have clients like that. Right.

Right. You know, that's actually one of the things my coworkers said when I when I came on. They're like, just so you know, this application is on the bleeding edge. Right? Everything we're doing was either in preview or still in preview.

And so we're figuring it out as we go along, but I've been in it now for a month, and and it it works out well. The guys that I'm working with are smart. You know, they they know what they're doing. They've you know, you have some roadblocks, and there's some things where you cut corners with the client. You come back and clean it up.

But all in all, it's it's well built, and they've got a lot of they figured out a lot of neat ways of of utilizing the the Microsoft stack to benefit us and the client, you know, and have minimal time on our end to get a tenant spin up. And and it's not it's not a lot of rigmarole or a whole new application. Right? So it's good. So you like the bleeding edge?

Is that one of the things that kinda made you, you know, wanna switch? No. You know, I switched because, well, it was it was time. You know? I like a challenge.

Right? Yes. I I do like to push myself, and I and I like figuring new things out. And I felt like I had kinda gotten in a bit of a a rut. You know?

I I I've gotten too comfortable in the last job. Bleeding edge is nice as long as it's not, like, cut your arteries bleeding edge. You know what I mean? Yeah. Yeah.

I definitely know what you mean. Yeah. Yeah. I I like bleeding edge as long as it works, It's production ready, and there's enough documentation for me to figure it out. Right?

Yeah. It doesn't have to be fully baked. It doesn't have to have, you know, hundreds of pages of documentation. I just you know, you you want a minimum you have a minimum expectation of what it's gonna do in a production environment. And then, you know, I can figure it out from there.

Right? Production environment, and then, you know, I can figure it out from there. Right? Yeah. I I kinda prefer to be on the cutting edge, not the not the bleeding edge.

Maybe the dull cutting edge. There you go. Right? Well, hey. You're beyond web forms.

Right? At least for the most part. Yep. Yep. I am not working on web forms in my main position anymore right now.

So I still do some side stuff that I've gotta deal with the web forms, but still trying to get out of those as quickly as possible. Yeah. Yeah. But no. It's amazing what you can do with just the dot net stack.

And I guess you could really say that about anything. Right? If someone was a PHP wizard, it's like, it's amazing what you can do with PHP. Right? But I don't do PHP.

But, you know, I think we've talked about this in previous episodes where dot net is everywhere. Right? And it just keeps, for lack of a better term, expanding and getting its tendrils in all these places you wouldn't necessarily expect, like Blazor. Right? You know?

Which to me makes the dot net framework that much more valuable for me. Right? Because it is it is my primary stack. Right? It's it's what I'm the most familiar with.

It's where I have the most experience. And if I can just continue to build on that, man, I'm I'm rolling. Are you doing testing? Are you doing test driven developments or anything along those lines? Not yet.

Like I said, I think this project has been moved to little too bleeding edge. Right? The iterations are are pretty quick, which is good. But, right, TDD is something you need practice at. You need time to do.

Yeah. I I could really I speak to that right now. Look. My current project, you know, I haven't done a lot of testing before, but they really wanna do a lot for this. And it's just I'm just finding that, you know, it takes me 3, 4 times as much time writing all the tests to to get the the code coverage and all the different things written, unit tests, integration tests, functional tests, you know, 3, 4 times.

I'll spend a day working on the code, and then 3 or 4 days working on the test for that code. It's like, man, that's a lot of overhead, you know. So if you Well, right. Need it, make sure it's worth it. It's worth it.

Right? As long as they're good tests, they're not brittle. Right? And you're actually, you know, running them and using some kind of, right, continuous integration, they're absolutely valuable, especially the larger the application gets. Yeah.

And I'm alluding learning I'm learning brand new patterns, you know, for writing code to make things that are testable because, you know, before in my code, I guess, a lot of thing was probably a little too tightly coupled, and I couldn't break it out and separate it to be tested. And you can't do that if you wanna have good tests. Nope. Nope. You cannot.

No. We're using the the the mock u framework Oh, yeah. And we're also using the auto fixture with x unit. So these are all new technologies that I haven't used them before. So it's it's interesting, but it's just it's right now, it's slow, you know, trying to figure out how that's done.

Right. Well, from the sound of you picked all good ones. I've used all those before as well. For instance, you know, n unit over x unit. And n unit's great.

But for for my needs and for the way I was testing and building things out, x unit was a better fit. So yep. Well, I think if you're good, we'll wrap up for today. We'll make this a short one, but we'll be back, guys. Right?

We're not going anywhere. Yep. We're not going anywhere. It's almost the holiday season, but we got some guests lined up, so stay tuned. Yep.

Should be Do you wanna do pics? I can do a a quick pick. Okay. I think I'm gonna pick driving in movie theaters. Ah, nice.

They were they were very common when I was a kid. My mom used to take me and my brothers out to them, things like that. Yeah. You know, I also remember being a a real little kid, and some friends wanted to go to movies. And, you know, they'd throw me down on the floor of the car and put a blanket over me so they don't have to pay for me to get in.

Oh, yep. Yep. So that kind of thing. But, you know, it's it's a way to be socially distanced in this time and get out of the house and watch something entertaining and still be safe. So Good.

Drive in movie theaters are are my pick. Perfect. Well, my pick is right in line with what I've been talking about, work related. For work, they let me pick out my own PC as long as it was under $2,000. And I ended up getting the HP Spectre X360.

And, man, this thing is sweet, and the display is ridiculous. So yep. Nice. Nice. I've got 2 Lonovos and 1 Dell laptop.

Now, actually, I have 3 Lonovos. 1's personal, one's for my the company that I work for, and the other one's for a company that I'm working on a project that they gotta have, you know, security and things like that. So it's its own laptop. Gotcha. And then Gotcha.

I have a I also have a Dell for another project they're working on. So I've got I've got 2 desktops and 4 laptops, and they all kinda they're all good. I've always had good luck with Lenovo, so those are good. But the Dell that I'm working on has been working just fine well as well. My desktop, I got an Alienware PC, so it's really Oh, yeah.

Souped up and ready. And I've got a VR headset on order. So Nice. Trying out some of that stuff. So Well, you can never have too many PCs.

Right? That's right. Don't tell my wife. Okay. I'll I'll keep it between us.

Alright. Alright, Sean. Thanks, Caleb. Yep. Thank you, and and we'll see y'all later.

Yep. If you wanna reach out to the show, you wanna get in touch with me, get me on Twitter at dotnetsuperhero. Alright. Bye y'all. Thanks, guys.

We'll catch everybody on the next episode of adventures in dotnet.
Album Art
All .NET Stack All The Time - .NET 212
0:00
20:17
Playback Speed: