Posts

Entity Framework Migration Best Practices

1.       Introduction Like code is flown into version control system our database scripts will also be flown into the version control system and upgrading and downgrading the system should be straightforward. Before starting the Migration: Every developer should have their own local database for development. They can’t use the shared database for development. -          Steps for Migration Enable Migration This is one-time activity per team. Mostly the team lead when setting up the project will be doing this process. Add-Migration For every new migration activity, we will be using this command to start the migration. Update-Migration After the changes are done and the changes are ready to push to the database. We will use this Update-Migration to push the changes to the database. 2.      Workflow When using migration for a single person it will seem less and easy to use and wo...

Multi-Tenant Data Architecture

Image
Multi-tenancy Models When any application planned to roll out for multiple regions/countries/clients then multi-tenancy model comes into picture. This can be classified into four models as below -        Separate Application Separate Database -        One Shared Application and Separate Database -        One Shared Application and Shared Database (Separate Schema) -        One Shared Application and Shared Database (Same Schema) These models are differentiated based on whether the data is isolated or shared. The difference between the shared data and the isolated data is a continuum with many variations that are possible. Sample Application URL for different implementations. Tenant Name URL Tenant 1 Tenant1.domainname.com Tenant 2 Tenant2.domainnam...

New to .NET?

Then must study .NET documentation. (<10 mins needed) https://docs.microsoft.com/en-us/dotnet/standard/tour

How to find Microsoft .NET Framework Version Installed?

Image
To find .NET Framework versions by viewing the registry (.NET Framework 4.5 and later) On the  Start  menu, choose  Run . In the  Open  box, enter  regedit.exe . You must have administrative credentials to run regedit.exe. In the Registry Editor, open the following subkey: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full Note that the path to the  Full  subkey includes the subkey  Net Framework rather than  .NET Framework . Note If the  Full  subkey is not present, then you do not have the .NET Framework 4.5 or later installed. Check for a DWORD value named  Release . The existence of the  Release DWORD indicates that the .NET Framework 4.5 or newer has been installed on that computer. The value of the  Release  DWORD indicates which version of the .NET Framework is installed. Value of the Release DWORD Version 378389 .NET Framework 4.5 378675 .NET Frame...

Developer Cheat Sheet

Image

Sending Email from Powershell

The Powershell comand to send email. $smtpServer = "0.0.0.0" $smtpFrom = "from@gmail.com" $smtpTo = "to@gmail.com" $messageSubject = "Subject of the email" $messageBody = "Body of the email" $smtp = New-Object Net.Mail.SmtpClient($smtpServer) $smtp.Send($smtpFrom,$smtpTo,$messagesubject,$messagebody)

MVC - Looping through the model properties from cshtml

When ever we are struck with the values being not properly filled in the model and need to print all the properties of the model or dto of the page then we can use the below lines of code to loop through the model or dto and write all the items in the page. foreach (var result in Model)             {                                   var type = result.GetType();                     var properties = type.GetProperties();                     <ul>                         @foreach (var property in properties)                         {                         <li>     ...

Automatic redirection of HTTP to HTTPS Settings

Url Rewriting module of IIS to redirect to secure url IIS 7 web.config should have this tag  <system.webServer> <rewrite>     <rules>         <rule name="HTTP to HTTPS redirect" stopProcessing="true">           <match url="(.*)" />             <conditions>               <add input="{HTTPS}" pattern="off" ignoreCase="true" />             </conditions>           <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />         </rule>     </rules>     </rewrite> </system.webServer> IIS 8.x ma...

.NET 4.6 Bug - Tail Call bug in RyuJIT - Quick Guid

UPDATE: Tail Call Bug has been fixed and here is the more details about it. http://blogs.msdn.com/b/dotnet/archive/2015/07/28/ryujit-bug-advisory-in-the-net-framework-4-6.aspx The following information has been collected from the below mentioned links and from my Friends.  This post is just a reference purpose and needs lot of testing to implement this solution. Reference: http://nickcraver.com/blog/2015/07/27/why-you-should-wait-on-dotnet-46/ https://github.com/dotnet/coreclr/issues/1296 What is Tail Call? Wonder full Blog post on Tail Call is here:  http://blogs.msdn.com/b/davbr/archive/2007/06/20/enter-leave-tailcall-hooks-part-2-tall-tales-of-tail-calls.aspx Who should be worried about :  -           .NET Framework 4.6 is installed on the machine running the application -           The application targets the ‘Any CPU’ or ‘x64’ platform ...

Quick tip on How to make Thinktecture server to work fast

1. Move the configuration database from file system to a Database Server (like sql or oracle) 2. If the first time load is slow then try making the application pool not to sleep (with added risk on the applciation server) To be care full when you do this if you are running many applications on the App Server

Error : ID4243: Could not create a SecurityToken.

For persons who worked on WIF Programming would encounter the following error, ID4243: Could not create a SecurityToken. A token was not found in the token cache and no cookie was found in the context We will be getting this error when the browser sends the cookie to the server and when sever validates the token and it fails then we may get this error. The end user can't do anything since the browser sends the token to the server always until the user manually clears the cookie from the browser. To handle this scenario we can srite the below list of code in the Global.asax.cs Basically, what it does is it will check for the excetion type and then it tries to sign out the user (delete the cookie informations) and redirect to the requested page. It is as simple as it is :) protected void Application_OnError() { var ex = Context.Error; if (!(ex is SecurityTokenException)) return; Context.ClearError(); if (FederatedAuthenticati...

Visual Studio Online First look..

Wondering what is Visual Studio Online! By reading this post you can get at-least the basic idea of what is Visual Studio Online and How helpful it will be for Individual Developers and small Team with out investing much. Visual Studio Online is a Cloud services for development teams to collaborate and manage software projects With the recent actions from Microsoft I am personally happy that MS is going with the market trends(free cloud storage, Dot net Framework becomes open source and releasing VS Community Edition for free etc) and that will help MS as well as people depend on MS Products like me. As a developer you might be knowing the features and benefits of Team Foundation Server (If not worth reading the MSDN link for TFS) and now assume if Microsoft provides the Cloud TFS Service for FREE!! Thats great to hear right.. You don't need to maintain the TFS Server backing up and other hurdles, every other thing will be taken care by the Visual Studio Online. Even ...

Visual Studio On line is great on the first look

Created an account with Visual Studio On line and checking out the features of it.. You can expect an article about it soon.

Glimpse - the Diagnostics Platform of the web

After may years of development and performance tuning, today i found a nice tool called 'Glimpse'. Now I am regretting why I din't explore this tool these many days..:-) Will write the detailed Blog over the week end. Stay tuned.

Create a SSIS Package - To Copy data from Oracle to SQL Server

Image
You should use Lookup to join the common column( same data type) of SQL server and Oracle and retrieve the values from Oracle which does not have a matching record in SQL server. Design  1.Using SSIS 2005 Drag a OleDB Source and point to your Oracle Database and select the table . Drag a lookup and select the SQL Server connection and point to its table . In columns tab join the common column and select the columns in the right hand side which you need to retrieve .  Click on Configure Error output and select redirect row for the join column .  Drag a Oledb Command and connect it to the error output from the lookup. 6.Write an insert statement in Oledb Command 2.If you are using SSIS 2008 then no need to configure the Error Output in lookup .Just drag the no match output from Lookup to SQL Server destination. Note: The same question I have asked in the http://stackoverflow.com and I got this response some years back and that helped me to solve my P...

I Have decided to Blog!! Yes you heared it right :)

Hello All, On a Friday morning every one plan for the weekend, Yes even I did the same and decided to Start a Blog. Blog??? What to write is the next question it comes to my mind... Yes of course whatever I am passionate about that, I need to write. Then I listed down what I am passionate about and the list was growing like something... Then I finally decided to write Blogs to help others as well as myself by writing my own challenging work experiences which I face day to day in my Work. Tired of reading my History of My Blogging... Let's go on to the real Blogs...