Monday 15 October 2018

Generic Modifier In & Out C#

In [Contravariant]

The image is self-explanatory.


Out [Covarient]

The image is self-explanatory.


Tuesday 11 September 2018

Reduce your Azure Development Subscription Cost


Azure VMs

Usually you should convey to developers and testers to shut down the VMs manually when they are not using non production virtual machines. Also there some ways to automatic shutdown the VMs like you can create and schedule a script to start and shutdown VMs based on use timings or you can use Dev Test labs.

Azure App Services

As app service plan allocate compute resources for which you pay so if you run multiple applications in same app service plan, that will definitely reduce your cost. If your app service plan tier is not fulfilling your new app requirements like it requires high computation resources or your exiting app service plan is already exceeding the resource utilization, than its better to create new one.

Friday 17 August 2018

Generic error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'isLoading: [object Object]'. Current value: 'isLoading: true'

Error: Generic error:  ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'isLoading: [object Object]'. Current value: 'isLoading: true'

Resolution:

setTimeout the code that is setting the value. In my case, it was ngRX store dispatch action so I have changed action like below.

It was like below =>

public setProgress(isLoading: boolean) {
this.store.dispatch(new SetLaoding(isLoading));
}

I changed it to =>

public setProgress(isLoading: boolean) {
setTimeout(() => {
this.store.dispatch(new SetLaoding(isLoading));
});
}

and then this error resolved.