Don't use FirstorDefault() unless you are sure its valid/ verified in the business scenario. else you are going to introduce bugs in the code.
Wednesday, August 9, 2017
using Linq methods with caution - E.g FirstorDefault()
Don't use FirstorDefault() unless you are sure its valid/ verified in the business scenario. else you are going to introduce bugs in the code.
Saturday, April 15, 2017
Git tips
Set up Git
Removing non-repository files with git?
--------------------------------------------------------------------------------------------------------------
How do I discard unstaged changes in Git?
Ans:
a)For a specific file use:
git checkout path/to/file/to/revert
b)For all unstaged files use:
git checkout -- .
Make sure to include the period at the end.
c)To check out specific filesgit checkout -- cats.html index.html
---------------------------------------------------------------------------------------------------------------------
git branch -a -- lists all branchesgit push origin :branchnamehere -- to delete the remote branch(note semicolin before branchname)
git remote show origin -- checks for stale branches tracking origin
git remote prune origin -- to clean up deleted remote branches
git tag -- list all tags
git tag -a v0.1.2.3 -m "versioncomments" -- add a new tag
git push --tags -- to push new tags
---------------------------------------------------------------------------------------------------------------------
git fetch -- pulls down the history but does not merge
rebase vs Merge
Rule of thumb:
1. When pulling changes from origin/develop onto your local develop use rebase.
git pull --rebase
2. When finishing a feature branch merge the changes back to develop.
rebase vs Merge
Rule of thumb:
1. When pulling changes from origin/develop onto your local develop use rebase.
git pull --rebase
2. When finishing a feature branch merge the changes back to develop.
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
Developer Basics
https://jeremydmiller.com/2014/11/07/strong_typed_configuration/
--------------------------------------------------------------------------------------
TDD rules : -
- Isolate the Ugly Stuff
- Push, Don’t Pull (this post)
- Test small before testing big
- Avoid a long tail
- Favor composition over inheritance
- Go declarative whenever possible
- Don’t treat testing code like a second class citizen
- Isolate your unit tests, or suffer the consequences!
- The unit tests will break someday
- Unit tests shall be easy to setup
ref: http://codebetter.com/jeremymiller/2006/03/09/jeremys-second-law-of-tdd-push-dont-pull/
--------------------------------------------------------------------------------------
Wednesday, April 12, 2017
WebApi Notes
In ASP.NET Web API 2
To return a custom response you can use new helper methods exposed through ApiController such as:
- Ok
- NotFound
- Exception
- Unauthorized
- BadRequest
- Conflict
- Redirect
- InvalidModelState
---------------------
13/11/2020 SignalR 2 (.net framework) Tip
You would be unable to connect to signalr 2 (.net version) running on your visual studio/localhost if the visual studio is not running as Admin.
Monday, April 3, 2017
Angular 2 on Azure
A Good post to publish on to a Azure
http://abusanad.net/2016/07/24/publish-angular-2-app-from-visual-studio-to-azure/#comment-8701
An important change to note is
Node is present on webapp server but it would not return version number with the command.
but the good news is npm install command works well.
Ref: https://blogs.msdn.microsoft.com/azureossds/2016/04/20/nodejs-and-npm-versions-on-azure-app-services/
Issue 1: 404 errors in the site
Situation: providing access to api data folders on azure.
Solution : Ref: https://blogs.msdn.microsoft.com/benjaminperkins/2014/09/01/the-webpage-cannot-be-found-404-when-accessing-a-file-on-azure-websites/
Subscribe to:
Posts (Atom)
Devops links
Build Versioning in Azure DevOps Pipelines
-
Build Versioning in Azure DevOps Pipelines
-
Don't use FirstorDefault() unless you are sure its valid/ verified in the business scenario. else you are going to introduce bugs in t...
-
Generate Dates and hour between Date Range DECLARE @start DateTime = getdate() -1, @end DateTime = getdate(); ; WITH Dates_CTE ...