In the last section, we have discussed, how to host application using HTTP.SYS. Now, in this section, we will address how to handle CORS issue with ASP.NET Core APP hosted using Http.Sys and Angular 4. With current setting shown below,
Thought to share new additions around dotnet cmd. I guess with these additions, this may be the perfect timing for building SPA (Single Page APP) with ASP.NET Core as backend and any of the below listed libraries as Front-end choice.
In today’s session, i will just share one of the debugging tips where in you have limited access to the box. Recently, for one requirement i promoted my code and that gets promoted to production and then tester approached me and said your change is not working. I said not possible, as i can prove the point with the same code running in my local box. But, error was there and it was not working in prod. So, what i did is requested for the DLL deployed in prod environment. And i tried below steps to reproduce the same locally.
1) 1st i replaced the same dll in my local box with the prod version and then it banged and gave me proper CLR Exception as shown below, at this point i proved that code is not deployed.
2) 2nd, I went one step ahead and compared my local box DLL with prod box. This also proves the point.
so, the idea is stay confident and prove confidently. Thats it.
Today, i have started working on one of my app framework projects where in i’m brushing up all required skills to write a good application framework. Basically, application framework i would say one time investment and long term return means if you write good framework initially, then you can smartly focus on business requirements at the later part. So, basically any application framework involves below listed bullet points like
1) General Naming conventions
2) Data Access Design
3) DI Technique say Ninject, Structure Map …etc
4) Error Handling and Logging Events
5) Security Infrastructure
6) UI Design
7) Client/Server Side Validations
8) many more can be listed, but these are basics.
But, the point is for writing these, you need to have good implementation knowledge of below listed points.
SOLID Principles – These principles have helped me a ton. They aren’t just rules to be followed blindly, but I’ve found that reasoning behind them and trying to make code clean, easy to understand, testable in the long run.
Design Patterns – Certain types of problems always come in software development. For these scenarios, we have design patterns. Getting hold on design patterns is something that only comes with practice. You won’t be able to memorize and recognize even the core set of patterns immediately, but over time you will recognize the same easily.
Test Driven Development – Make it habit or in your DNA. It not only helps to test the code, it helps me design my code. That’s a big advantage that a lot of people overlook. It also gives me confidence that the class I’m creating does exactly what it is supposed to do, and nothing more. TDD also makes sure that if you are adding any new feature in your application that is not going to break the existing ones, if all tests ran expectedly.
Resharper – Resharper is essential for doing C# development in my opinion. Out of the box, it will suggest lots of little things that can help improve your code. It helped me learn LINQ by offering to convert tedious long code into elegant LINQ expressions, and it finally convinced me that ‘var’ isn’t always evil.
Lambda expressions – These are essential when working with C# . They’re a bit hard to grasp at first, but they open up very interesting re-use possibilities, and lots of APIs leverage them heavily.
Generics – This is an older C# feature, but still this is one of the most important piece to learn.It opens up new avenues for creating clean, extensible, and reusable classes.
StructureMap – One of the biggest change at the moment. This totally changed how one code. Now when I realize a class I’m working on is going to need some other service to fullfill its responsibilities, I simply create a new service interface and add it to my class’s constructor. This makes my development much easier.
LINQ – Make this habit as well. I am still learning LINQ. Most of the times for complex queries i make use of LINQPAD or refer msdn Linq samples.
Moq – Mocking frameworks allow you to configure stubs or fakes that you can substitute for dependencies while testing your classes. Moq is one of my favorites for its fluent, lambda-based syntax. off-course this piece also i always try to make use of as much as possible.
So, these are the few things in my opinion are must have things for any mature developer.
Price comparison is done keeping “Amazon.com” as benchmark. You can buy same book at discounted price from my store….This is Pre Launch Offer. Book is getting released world wide in another 10-15 days at leading book store. But, you can book your ebook copy now at discounted price from my store…..Upon Ordering you will receive 1st sample chapter now, and complete book in 10-15 days on your email, when the book is officially released….Other formats will also be available soon….