Powershell – scripting language. Fileext = .ps1 Tools: Powershell Console and ISE (intellisense capable, tabbed navi, testing scripts etc) Cmdlets = name for Powershell commands (Get-Command etc..) installed as part of WMF (WM4 is latest, WM5 is preview). Commands avl may vary by OS, Test-NetConection not avl in Win7, only Win8 and above. Cmdlets and parameters have aliases like […]
Author: p k
Deployment Publishing and Continuous Integration
Fake (F# based) or PSake (powershell based) or Cake (C# based) Deployment and CI.. Other alternatives: TeamCity, Jenkins, Octopus, AppWare, TFS Builds DB publishing: DacFx (Dacpac approach) http://www.iis.net/learn/publish/using-web-deploy/dbdacfx-provider-for-incremental-database-publishing DbSqlPackage Provider (soon to be deprecated) https://msdn.microsoft.com/en-us/library/hh550081%28v=vs.103%29.aspx SqlPackage tool: https://msdn.microsoft.com/en-us/library/hh550080(v=vs.103).aspx DB Lifecycle Management (Key/Root Article) https://msdn.microsoft.com/en-us/library/jj907294.aspx
Standards Best Practices and Samples
https://www.roberthalf.com/technology/blog/4-best-practices-for-microsoft-net-framework-and-applications http://jasonwatmore.com/archive.aspx http://webdevchecklist.com/ http://www.developerfusion.com/article/8307/aspnet-patterns-every-developer-should-know/ Business transactions: http://stackoverflow.com/questions/19548531/unit-of-work-repository-pattern-the-fall-of-the-business-transaction-concept
Identity Server, Claims, Tokens, Idp, Rp, STS, Saml, OpenId, OAuth, Bearer Token, SSO
Identity Server3 – Getting Started with Step wise Code Samples https://identityserver.github.io/Documentation/docsv2/overview/mvcGettingStarted.html Using an ACS (Access Control Service/Namespace) for Claims based Federation https://blog.kloud.com.au/2014/06/06/claims-based-federation-service-using-microsoft-azure/ Using OWIN and Azure Ad to Secure MVC and Web Api http://www.cloudidentity.com/blog/2014/04/28/use-owin-azure-ad-to-secure-both-mvc-ux-and-web-api-in-the-same-project/ Adding minimal OWIN auth to an existing MVC WebApp http://weblog.west-wind.com/posts/2015/Apr/29/Adding-minimal-OWIN-Identity-Authentication-to-an-Existing-ASPNET-MVC-Application#MinimalCodeSummary OWIN OpenID Connect Middleware Flow Explained (and EBook) https://www.microsoftpressstore.com/articles/article.aspx?p=2473126 Azure Active […]
Query Performance
Measurement of sproc query performance: =========================================== ## Tools to use: =============== – Include actual query plan in ssms – Look for NCI/CI Index scan – Look for Key Lookups – Use Index usage stats to figure out which index is being used.. – Make covering indexes based to reduce Key Lookups..(Select or where clauses go […]
Design Pattern Snippets
## Singleton: A singleton stores common data in only one place. public sealed class SiteStructure { object[] _data = new object[10]; static readonly SiteStructure _instance = new SiteStructure(); public static SiteStructure Instance { get { return _instance; } } private SiteStructure() { // Initialize members here. } } =================== Best Practice: Use Lazy<T> to init […]
Using Debounce for Keypress events in Autocomplete
<form> <div class=”status-key”>Type here. I will detect when you stop typing</div> <input type=”text” class=”autocomplete”> <div class=”status-ajax”></div> </form> Javascript: $(document).ready(function(){ var $statusKey = $(‘.status-key’); var $statusAjax = $(‘.status-ajax’); var intervalId; // Fake ajax request. Just for demo function make_ajax_request(e){ var that = this; $statusAjax.html(‘That\’s enough waiting. Making now the ajax request’); intervalId = setTimeout(function(){ $statusKey.html(‘Type here. […]
Database versioning (DB Lifecycle Management)
The state-driven approach is good for projects with a lot of logic in the database and a large team working on it. You are also better off choosing it for small projects that are not in production yet. The migration-driven approach is a better choice in all other cases Summary Article: http://enterprisecraftsmanship.com/2015/08/10/database-versioning-best-practices/ State based vs […]
DNVM Dotnet Version Manager DNX and Dotnet Execution Environment
Path = C:\Program Files\Microsoft DNX\DNVM\ On command prompt run: dnvm list This will help initial setup of DNVM. if dnx is not found run: dnvm use default -p The option -p sets up path to dnx permanently in PATH variable. Exclude -p to setup dnx only for the current command prompt session. Purpose and use: EntityFramework […]
SQL Server Cursors – Local, Static, Fast Forward, Read Only
What impact can different cursor options have? Best use – LOCAL FAST_FORWARD than default.