Yo. If I may ask a question about your choice, why did you choose C#, and have you considered Kotlin (since, AFAIU, it brings a lot of the good parts of C# to JVM world)?
@@MagicNumberArg I did not really have a choice. On my new job there is some C# software that i will have to maintain. So i started using C# for my own projects. I want to keep personal complexity as low as possible since i am just kind of starting out. But thanks for pointing that out. I might have a look at Kotlin :)
An interesting take on the subject. I like how these are more business level functionality focused rather than more developer-focused and granular like I have on my video on the subject. Nice stuff 🙏 PS: I historically had scaling issues with Seq and I can't really recommend it to anyone, at least not if you want long term retention (7-15 days+) in a high throughput environment
Your channel is very different, its very granular and low level examples of how to optimize code where as Tim Corey has a broader perspective and more of a overview. Both are are obviously great depending what you are out after.
I'd love a video or video-series about software-architecture and clean code. I've seen your videos about SOLID and DRY and Refactoring and many more that kinda talk about that topic. But as my applications are growing I still think they become a bit messy. Like where do i put all the Interfaces for dependency Injection. Where do i put all the Repositories for a repository pattern and so on. But also something like, how to manage overloads, or to many parameters for a method. Or I also struggle sometimes to find out which responsibility is something. Let's say for example a chess programm, who stores the position of a chess piece? The piece itself, the board, a tile on the board, or an extra gamestate class,...? And then further who would move those pieces..? I know there a no clear answers to those questions. But any tip or trick on those questions can be really helpfull.
I used Hangfire for job scheduling and it is easy to implement it. But only problem is to process parallel jobs we have to purchase the license Hangfire Ace packages
Interesting - will look at EPPlus as it may put a lot of protections against the inconsistency of the Excel reference And I like the though of better logging And the email one Papercut makes sense for us.
So surprised that the Dapper, the AutoMapper, and the Nowtonsoft.JSON are not on the list. Maybe they are not just suggested but are necessary ones that no need to mention again. :)
In regards to your comments about logging, I have a routine that copies data from an Oracle server to an MS SQL Server. It massages some of the data. I like to log what I call exceptions. Data that doesn't fit the norm, but not NECESSARILY incorrect data. If a user calls and indicates that something looks amiss I can pull up that log to see if an exception existed and if so, what didn't it like about it? Do I read the logs? Not normally - only when warranted.
Just be careful there, because that logged data could be sensitive in nature. It is also not connected with the actual data, so you could run into legal issues if a user asks to be forgotten and you leave their information in the log files.
@@IAmTimCorey Thank you for the advice - and it's very solid advice. In this case the exceptions aren't tied to any personal data whatsoever and everything in this data that I'm retrieving is considered public information. I haven't implemented this logging as of yet, just something that I'm looking into. I need for staff to know what data that looked suspicious such as missing a property description. The program makes a safe assumption but it might not be the correct assumption. The owner of the data needs to be aware of the issue and decide whether it is a problem or not.
11:21 in this modern era of *everything must be free* or it won't ever gain traction, it's probably an invalid assumption that every "commercial application" is making money. That said, I fully support paying people for great work and valuable products. I'm not an *everything must be free* advocate.
If you aren't making money then you aren't a commercial application. If you aren't making a profit, that's another issue and not really the fault of the tools you used. We wouldn't expect to not make payments on a delivery vehicle just because no one is buying our products out of it. That's what I was saying.
Suggestion: Instead of giving specific usage of each tool, consider teaching on your approach to evaluating new tools. From what I have learned from you, you would create a new project that exercises only the tool in question. Maybe you can talk through your approach. Highlight things you'd consider a "red flag" (show stopper) or "yellow flag" (concern).
No problem paying for libraries, someone took their time to write that coffee so you don't have to. However once a price is involved then the question becomes is it worth to pay x in money or time for the desired functionality
Awesome video, Tim! Just wanted to let you know a better reason to pay for NuGet packages that you deploy to production; usually you're not buying the rights to use the package, but the ability to get enterprise support for it. This is incredibly valuable, since why would you want your customers to rely on code that you can't support?
In asp.net core web api, is it possible to raise an event from an class, and listen to this event from another class and based on the event, do some task. How to achieve this? Also what is event-event handler-event bus? Very confusing. I was trying to decouple events in a standard .net library and was trying to move all events in one library. But got very confused.
I have used github.com/vilppu/OpenHtmlToPdf to convert HTML to PDF in the but under the hood most of the nuget packages out there use wkhtmltopdf under the hood.
Hi Tim, Do you have any experience freelancing? Is it possible to freelance if you are a c# web developer? I would like to see a video from you on this topic.
If you more interested in MassTransit you should check this playlist by the creator of the package himself: ru-vid.com/group/PLx8uyNNs1ri2MBx6BjPum5j9_MMdIfM9C
@@GeorgiMarokov I used an earlier version of MassTransit for an event driven system we had at my previous place of employment. We had upwards of 100,000,000+ messages a day going through the system. I would definitely use MassTransit again for a future project. As a matter of fact . . . now that I'm at a place that is Linux based, I look forward to trying out the latest MassTransit using .NET Core.
The "don't use real email addresses" part remembers me of a one-day-trail at a local web solutions company. I had to send some template mails, and i was new to javascript at that time. I ended up flooding the inbox of the company ceo with thousands of sample mails. Maybe i would've got the job if i flooded a testserver instead :D
Valuable lesson learned and Thank You for sharing. Hopefully others can learn from this. Don't use real "data", even if you think its secured and completely under your control. CEO's email address as test data did not work so well in this case. Avoid using real data (Actual account numbers, email addressed, credit card numbers, personal information, etc.) even when you are on a test server. I have seen too many "fails" where testing has impacted real world production environments.
The most classic example I can think of was from the 90s. One guy in a large Bank made a test email supposed to go to those with more than than a certain amount in the Account. He started them with Dear Rich Bastard. Unfortunately it went out to the actual customers :). He got fired for that. Not sure I would have been offended personally, kinda funny thing to get from your bank :).
@@marcusmaunula5018 I agree it's always best to just buy the license and at that point it will be great to consider devexpress or telerik and others too.
An email library is what we use to send email from C# code. It still needs to connect to an email server (like Gmail) to send the actual email. Think of a C# email library as replacing the user typing out the message in an email client. C# does the typing and hits send. It relies on an email server to do the rest.
Excellent - Thank you. This will benefit many other viewers so I added it to the video. Just so you know, you need to start with "0:00 " to get RU-vid to pick it up and apply it to the video, so I added "0:00 Intro"
How is EPPlus better then OpenXMLand ExcelDataReader for reading and creating Excel spreadsheets? I spent a lot of time figuring out how to use those and find examples to create spreasheets with validation and import/export those spreadsheets for my business. I used ExcelDataReader because it was simple to read a spreadsheet created by someone else and skip the headers and columns that didn't match my criteria. I have something that works and unless it is WAY simple, I don't want to change anything at the moment, although I would like to upgrade my desktop application to .NET 5.0 and take advantage of new features. However, I'm stuck with some windows functionality in my library (yes probably a bad practice) to popup errors when trying to import spreadsheets and allow a retry.
I would say Quartz is much better than Hangfire but it really depends on what you want to do. Quartz has more features and it's even easier with Crystal Quartz (Remote UI) to schedule jobs,maintain and re trigger them. Great video Tim.
I have a video request: Could you create a video where you explain Semaphores in detail? And maybe explain the differences between them, Mutex and Lock and also some best practices.
I'd love a video on creating PDF/printable reports on .NET 5 Razor/MVC state of the art. Everything I find seems to be old, ugly or generally both. I used Crystal Reports many years ago. That was quite powerful (although, again, ugly and not friendly to use). But I'm not sure what people are using nowadays to create some custom reports from a business web application.
Agreed! Like you, I looked around and was disappointed with the choices. Crystal isn't even an option anymore (except for people sticking to .NET Framework). SAP's (who owns Crystal) forum threads about it show that they have no clue what .NET Core is and say they will never support it. Our company is giving SSRS a try, and it seems decent so far. It lets you use a GUI tool to lay out the reports (taking that load off of the C# programmer), and then your C# code can grab the report via URL (and pass parameters and get back a PDF or whatever).
I used to rely on RDL/RDLC reports back in the framework days as well. I moved to DocX and EPPlus to create my Word and Excel-based reports, respectively. There aren't the visual cues you get from designing your report, but I found it easier to create my reports exactly like I want with the data I want.
It's a sad state of affairs when you have to explain, especially to developers, why it's fair to charge a fee to use someone's code, especially for commercial use. Software is expected to be free, while hardware isn't.
I don't remember how often I've had to explain to people that software is not cheap. Software is expensive. And the only reason people can get their (almost) free apps, webservices, etcetera, is because millions of development hours have gone into them over time... For applications that have millions of installations, that's fine and it can be spread over all users. For applications that are very specific for just one customer, not so much... I'm happy to pay for libraries, but it's sometimes hard to explain to custormers why they should. :)
@@teijeterbals1203 The big reason software perceived as free is because it's not a physical product. No matter ho much money was spent developing the software, the very fact that it isn't made up of atoms makes it difficult to accept its true value. In the old days when software was distributed on disks with a manual in a box, it had a higher value as the packaging made it at least something you can hold in your hands. Moreover, the fact that it costs nothing to deliver software increases this perception. If it costs nothing for you to upload it on a server for downloading, then it should cost nothing for someone to obtain a copy of it.
Hey Tim, just got my first job as a Trainee Web Developer. My main language is Javascript(I've been a React/Nodejs developer for more than a year) but they asked me to learn C# at work. Your videos are helping a lot.
Any time you have an application that wants to talk to another application in a disconnected manner. Microservices use this technique heavily but it doesn't have to be only them. Having this disconnect means that you can separate out parts of your application and update them without taking down the whole system or even losing anything while they are down.
@@IAmTimCorey Thanks for the very informative explanation, so compared to basic API communication in case using messages brokers we won't need to handle the acknowledgment part, am I right? Also, one more question related to Hangfire Can it be used to keep that data sync between applications? if not, what's the process to keep the data sync?
I am a beginner to C# and I have found your every video really good, informative and helpful, So I wanna thank to you for your great contribution in the learning community, Thanks a lot sir!!!!!!!!!
Hi Tim, Thanks for sharing such a wonderful post once again. I was wandering whether there are some inbuilt tools to validate Excel data while importing to database. I want to validate my excel file such as columns datatype,sequence,number of columns etc and then store into DB and azure BLOB storage. Thanks Uttam tam,
Thanks for a very interesting video. It would be great if you would teach more on Hangfire and share a little more details how you used it before. I would also really like a comparison between Hangfire and a Windows Service - when to use which and maybe to mix them. A .Net Core Windows Service is very easy to use as you already demonstrated in one of your videos if you need something to run every 5 minutes (or whatever interval) but what about once a day at a set hour or other variations? That cannot be done without some workarounds but maybe Hangfire is useful there???
Face reveal WHOOP WHOOP, face reveal WHOOP WHOOP. Can you make a video on how you become such a Legend and Awesome Homie please. I also want to be awesome and manly like you
Regarding EPPlus, if they're making great product and spending their own time and effort, they should definitely charge some amount. But from 0 to 30 bucks a month, PER license? That's a bit of a jump.
It is a big jump, but that's only because they weren't charging originally. That $30/month is not unreasonable for a commercial organization (which is what that covers). It is actually $300/year/developer for unlimited licenses (the $30/month is for smaller situations and probably not valuable). That means you can have the EPPlus tool for as many applications as you want and that license is per developer, not per person. Bottom line is that yes, it is expensive, but it is in line with other similar tools. If you went to Telerik and wanted just one tool, you would pay a LOT more (their cheapest one is probably JustMock at $399 for lite support plus $199/year after that per developer). Asking for less than 10% of that for a tool you will use often seems reasonable.
Hi Tim, I would like to know what is best for create and manage jobs? Azure web jobs vs Azure Functions vs HangFire? I appreciate it your comment, Thanks
Great list. I tried a different library called ExcelMapper once epplus changes its licensing model. Really cool library to convert excel to pocos. Really made working with excelfiles a breeze.
I have not found NPOI to be a better product. Also, while I like supporting open-source projects, I do get concerned when there is not an income stream option for the author. That causes problems of long-term sustainability. EPPlus provides a free product, as well as a paid product, which means they have a more sustainable long-term solution.
i would be glad if can make a video from a library who is working with the task scheduler system what you can write in your csharp application like the nuget packge task scheduler
I am a newby somewhat - I use windows task scheduler for my recurring jobs. Is hangfire basically the same or are there major differences I am not seeing
Hangfire will give you a much better picture of what has been done (great dashboard), it will have better reschedule/retry operations, and you can be more granular in how you schedule your tasks. Basically, you will have a lot more power. If you don't need the additional power, stick with what works.
Also if you need log viewer you can use my open source project at github.com/Analogy-LogViewer/Analogy.LogViewer it supports many log frameworks and even has real time server
Thank you for awesome suggestions Tim! I think Serilog is especially useful along with this things for handling of emails. Can I purchase your courses with crypto currency? It’s a bummer but I can’t pay with credit or debit card because we don’t have Visas or Mastercards in my area (because it is ruled by thugs and plain idiots).
No, FluentEmail is not the place to start when you want to send emails from C#. The place to start is System.Net.Mail.Message and chances are high that you won't need anything else.
The SmtpClient is now obsolete so you do need to consider moving off of it: docs.microsoft.com/en-us/dotnet/api/System.Net.Mail.SmtpClient?view=net-5.0
I just wanted to take this moment to say Thank You!! Your content is amazing in fact i bought a few courses on your website. So far i have learned alot and i am not even halfway through. So thank you! Keep going your helping a lot of devs this way.
Many libraries are free and open source. Paying for libraries is against that ethos. "you should pay" - so you're saying you're against open source free software then?!
That's not what I said and it is also a misunderstanding of open source. What I said was that if a package maintainer asks you to pay for something but you could cheat and say it was for personal use and abuse their trust, don't do that. Pay them if you are using it in production like they requested. As for open source, that does not mean free. Just because you can read the source code does not give you the automatic right to use it however you want. The license tells you what you can and cannot do. Just because you can read a book does not give you the right to claim it as your own or copy whole sections for your own use. I stand firmly for abiding by the requirements put forth in the license. If the creator is generous enough to permit commercial use without payment, go for it. However, if the license permits only development use for free and requires payment for commercial use (like the EPPlus license), then I will pay and I am urging you to do the same.
@@IAmTimCorey Also a misunderstanding of the word "free". Stallman who created the concept was clear that free in this case means freedom not that everything should be free.
Really enjoying all of your videos! Great explanations and easy to follow along. This video is really helpful and I think important so we don't think to hard and overcomplicate things. Thank you for your work!
Hope i'm not hijacking the thread, but would be curious if anyone knows of a good generalized text parser? And will add another note for useful library. This one handles command line parse, especially when it might get a little involved. Really handy, why so good? You define a class for various alternate command line settings. Worked on an app that might spin off one one of 12 other programs, and this helped. But still in a more traditional single/stand-alone app. Effectively you define a class, the library will inspect your define ProgramArgs class, and will handle the validation and error reporting of the message as defined. The library allows annotating your defined class with attributes to allow you to build up and customize it. And even better if parsed and no exception, immediately you have access to an instance the command argument class that match for the valid config. On larger applications have seen where the validation, error message and reporting starts getting rather disjoint at times. Not sure NuGet or GitHub is easier for all? Nugget: -> in VS CommandLineParser (in VS) Nuget/web -> www.nuget.org/packages/CommandLineParser/2.6.0 GitHub: => github.com/commandlineparser/commandline
That's pretty much the biggest problem. And especially with these two requirements, unfortunately, it's usually the case that the ones you can use are usually quite expensive.
I'm new to C# and I'm enjoying your videos very much. I was reviewing this video on Libraries and I tried downloading one. The big question I have now is, where do you get documentation on what's in the library and how to use it. I did a lot of googling but didn't find any answer. Thanks for any help you can provide. My particular hurdle right now is CSV files.
How to pop up selectable data rows from textbox i.e. a textbox in a form when space key pressed a pop up will appear from db and we can select the name of the firm that we want for transaction, on selection the selected value will go inside the textbox child ti parent .
Hangfire does store jobs in a database, along with the outcome of the executions of those jobs. As for per-user hangfire, I'm not sure what you mean. The hangfire service will run as one user. However, you could create jobs for each user.
@@IAmTimCorey ohh okay, so I am building an app where I'll have recurring jobs per user. So for example, a user will input that every Sunday to execute a purchase of X dollar bitcoin using an API. Would I be able to store the user recurring jobs in the dB and would hangfire be able to handle these types of recurring buys? Thanks!
I don't think there is an exact correlation here. Seq is a dashboard for displaying and working with application logs. It isn't really an analytics platform, etc.
hello tim, happy new year. Well, I wanted to ask you if you have the resources to guide me in the development for an application such as Uala or Nesqui (Mobile Banking App) using xamarin form
My list is long and I make no promises that just because I put something on my list, that I will get to it. But still, its good to know its still of interest.
Let's suppose that you are developing an app that is consuming an API that you know to have a 10 calls per minute limit. What you would use to manage this? Would you use "Hangfire" to create a recurring job to call that API every 6 secs our you would use "Polly" and create a policy to workout the 429 response from that API? Hopefully I made myself clear. I'm not a very good english writer. Cheers from Brazil :)
Is your new app the ONLY consumer of that API? Is the 10 calls a minute an average or is something enforcing it? ... sorry, its the performance tester in me from a prior life.
@@tomthelestaff-iamtimcorey7597 Thanks for the reply, I really appreciate. There is a policy in the API enforcing 10 calls per minute per user limit. We can consider that the new app is the only consumer.
You would put logic in to keep it to six calls. If you want to max out what you can do, hangfire might be the right call. Either way, you need to handle the 429.