Recently we’ve been talking about Dependency Injection. Currently you should know how to use Autofac. Today we’ll learn about things that you may find useful in one of your project. Modules As you may know in big project you’ll have lots of services to inject. That will leave you with multiple lines of code that…
Read MoreClient input validation
Previously we’ve been talking about DTO, mostly in WebAPI controllers, but it can be used everywhere. Today last of basic topics that every developer should know about, input validation. I’m not going to try to convince you that validation is important in places where external client will put his data. It should be obvious. What’s…
Read MoreAutoMapper and DTO
There are times developer need to implement something boring to make application easier to maintain. Fortunately there are millions of people that have the same problem and already developed solution. One of the worst thing to do is mapping one object to another, but it’s not a problem because we have AutoMapper. Additionally we’ll talk…
Read MoreDependency Injection
We’re not going to talk about whole SOLID extensively, maybe in future when there will be good time for it like this, but it’s sin to touch Dependency Injection without saying anything about 5th SOLID principle, Dependency Inversion, mind different name. Dependency Inversion Main point of Dependency Inversion is to decouple your code. It means…
Read MoreDbContext vs Repo and UOW
This topic was discussed by a lot of developers. It’s not hard to find good article about it, but only if you know what you are looking for. When I started working with EF it was much easier to find articles that gave wrong answer, that’s why for pretty long time I was using bad…
Read MoreServer-side loading – AutoSFaP
Previously we’ve talked about client-side and server-side loading. As I promised before, today we’ll look at examples of server-side loading using AutoSFaP. AutoSFaP AutoSFaP or Auto Sort, Filter and Paging is nuget package I implemented when I was learning ASP.Net core WebAPI. It is very easy to use and may help you create endpoints with…
Read MoreServer-client side part 1
When your API will become public and someone will consume it, you’ll face dilemma. Should you introduce client-side filtering or server-side filtering. Client-side and Server-side are concepts well known in Web Applications. It’s choice, where should you do the work, in client browser or your server. In general it’s better to send to the client…
Read MoreEF Pitfalls
Every technology has its pitfalls. You may not even notice it. Here, I’ll present some of the most important pitfalls of Entity Framework that you should learn about and have an eye on during development. Additionally interviewers commonly asks about those things, because if you know answer for these, it’s sure you’ve been working with…
Read MoreEntity Framework Advanced
Our client liked first version of Student application, and asked if we can extend it by adding new features. Students should get access to every course. Additionally teachers should be able to give them assessment. Every marks should have weight, so Exam marks will be the most important and homework mark less. Client said that…
Read MoreOpenAPI – Swagger
How do you use Web APIs at your work? Simple, I need to open code to check what request is expected by action, then I need to check what response will be returned to me. When I have all the information I can start writing client code. If there are problems, for example I don’t…
Read More