Thursday, September 12, 2019

Git

Git is a distributed version-control system for tracking changes in source code during software development. It is designed for coordinating work among programmers, but it can be used to track changes in any set of files. Its goals include speed, data integrity,and support for distributed, non-linear workflows.

Git: Prevent commits in master branch



  1. Go to your repository.
  2. Create file .git/hooks/pre-commit with following content:
    #!/bin/sh
    
    branch="$(git rev-parse --abbrev-ref HEAD)"
    
    if [ "$branch" = "master" ]; then
      echo "You can't commit directly to master branch"
      exit 1
    fi
    
  3. Make it executable (not required on Windows):
    $ chmod +x .git/hooks/pre-commit
    
To disable fast-forward merges you must also add following option to your .git/config file:
[branch "master"]
    mergeoptions = --no-ff
If you want also protect master branch on your remote, check this answer: How to restrict access to master branch on git

pre-commit
#!/bin/sh
# prevent commit to local master branch
branch=`git symbolic-ref HEAD`
if [ "$branch" = "refs/heads/master" ]; then
echo "pre-commit hook: Can not commit to the local master branch."
exit 1
fi
exit 0

pre-push
#!/bin/sh
# Prevent push to remote master branch
while read local_ref local_sha remote_ref remote_sha
do
if [ "$remote_ref" = "refs/heads/master" ]; then
echo "pre-push hook: Can not push to remote master branch."
exit 1
fi
done
exit 0


GIT: Prevent pushing to master




#!/bin/bash
protected_branch='master'
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
if [ $protected_branch = $current_branch ]
then
    read -p "You're about to push master, is that what you intended? [y|n] " -n 1 -r < /dev/tty
    echo
    if echo $REPLY | grep -E '^[Yy]$' > /dev/null
    then
        exit 0 # push will execute
    fi
    exit 1 # push will not execute
else
    exit 0 # push will execute
fi


------------------------------------------------------------------------------------------------

git commands
----------------
git pull
git fetch --prune
git reset --hard @{u}
git stash
git stash pop
git status
git push
git log
q or shift + q --> for exist

git log --stat
git log --stat --oneline > ./ss.txt
git dif commt1..commt2


---for automatic branching
git flow init
Initialized empty Git repository in ~/project/.git/
No branches exist yet. Base branches must be created now.
Branch name for production releases: [master]
Branch name for "next release" development: [develop]

How to name your supporting branch prefixes?
Feature branches? [feature/]
Release branches? [release/]
Hotfix branches? [hotfix/]
Support branches? [support/]
Version tag prefix? []
git branch
* develop
  master
--------------------------------------------------------------------------

Tuesday, August 27, 2019

Sql server - useful scripts

--Over operator
SELECT row_number() over(ORDER BY prod.productid) rownum, cat.CategoryName , prod.ProductName FROM Categories cat INNER JOIN products prod ON cat.CategoryID=prod.CategoryID

SELECT  ROW_NUMBER() over(PARTITION BY cat.categoryid ORDER BY prod.productid) ProductWiseRowNum,
row_number() over(ORDER BY (SELECT 1)) rownum, cat.CategoryName,prod.ProductName
FROM Categories cat INNER JOIN products prod ON cat.CategoryID=prod.CategoryID

SELECT dense_rank() over(ORDER BY cat.categoryid) CategoryWiseRowNum,cat.CategoryName,ROW_NUMBER() over(PARTITION BY cat.categoryid ORDER BY prod.productid) ProductWiseRowNum,prod.ProductName
FROM Categories cat INNER JOIN products prod ON cat.CategoryID=prod.CategoryID
SELECT prod.ProductName, sum(ord.Quantity*ord.UnitPrice) [TotalAmout]
FROM [Order Details] ord
INNER JOIN Products prod ON ord.ProductID=prod.ProductID
GROUP BY prod.ProductName 

--Running totals - Aggregation with Over Operator - 2012
SELECT productname,
       TotalAmout,
       sum([TotalAmout]) OVER(ORDER BY productname) AS RunningTotal
FROM
  (SELECT prod.ProductName,
          sum(ord.Quantity*ord.UnitPrice) [TotalAmout]
   FROM [Order Details] ord
   INNER JOIN Products prod ON ord.ProductID=prod.ProductID
   GROUP BY prod.ProductName) t
SELECT cat.CategoryName,
       productname,
       TotalAmout,
       sum([TotalAmout]) over(PARTITION BY cat.categoryid
                              ORDER BY productname) AS RunningTotal
FROM
  (SELECT prod.CategoryID,
          prod.ProductName,
          sum(ord.Quantity*ord.UnitPrice) [TotalAmout]
   FROM [Order Details] ord
   INNER JOIN Products prod ON ord.ProductID=prod.ProductID
   GROUP BY prod.ProductName,
            prod.CategoryID) t
INNER JOIN Categories cat ON t.CategoryID=cat.CategoryID

--Lead and Lag
SELECT cust.CustomerID,
       cust.CompanyName,
       ord.OrderDate,
       LEAD(ord.OrderDate) over(PARTITION BY cust.companyname
                                ORDER BY ord.orderdate) [NextOrderDate],
       LAG(ord.OrderDate) over(PARTITION BY cust.companyname
                                ORDER BY ord.orderdate) [PreviousOrderDate]
FROM orders ord
INNER JOIN Customers cust ON ord.CustomerID=cust.CustomerID 
WITH CTE AS
  (SELECT cust.CustomerID,
          cust.CompanyName,
          ord.OrderDate,
          LEAD(ord.OrderDate) over(PARTITION BY cust.companyname
                                   ORDER BY ord.orderdate) [NextOrderDate],
                              LAG(ord.OrderDate) over(PARTITION BY cust.companyname
                                                      ORDER BY ord.orderdate) [PreviousOrderDate]
   FROM orders ord
   INNER JOIN Customers cust ON ord.CustomerID=cust.CustomerID)
SELECT CustomerID,
       CompanyName,
       ISNULL(DATEDIFF(dd,OrderDate,isnull(NextOrderDate,OrderDate)),0) [NextDateDifference],
       ISNULL(DATEDIFF(dd,isnull(PreviousOrderDate,OrderDate),OrderDate),0) [PreviousDateDifference],
       OrderDate,
       NextOrderDate,
       PreviousOrderDate
FROM CTE
 --select DATEDIFF(dd,'1997-08-25 00:00:00.000','1997-10-03 00:00:00.000')

 --Paging
DECLARE @PageNumber int=3 DECLARE @PageSize int=10 DECLARE @StartPage int,@EndPage int
SET @StartPage=@PageNumber*@PageSize-@PageSize+1
SET @EndPage=@PageNumber*@PageSize
SELECT *
FROM
  (SELECT ROW_NUMBER() Over(ORDER BY ord.orderid) AS RowNum,*
   FROM orders ord) t
WHERE t.RowNum BETWEEN @StartPage AND @EndPage
SELECT @StartPage,@EndPage

DECLARE @PageNumber int=3 DECLARE @PageSize int=10 DECLARE @StartPage int,@EndPage int
SET @StartPage=@PageNumber*@PageSize-@PageSize+1
SET @EndPage=@PageNumber*@PageSize
SELECT *
FROM
  (SELECT ROW_NUMBER() Over(ORDER BY(SELECT 1)) AS RowNum,*
   FROM orders ord) t
WHERE t.RowNum BETWEEN @StartPage AND @EndPage
SELECT *
   FROM orders ord
 ORDER BY ord.orderid
OFFSET 20 ROWS
FETCH NEXT 10 ROWS ONLY
DECLARE @PageNumber int=3 DECLARE @PageSize int=10 DECLARE @StartPage int,@EndPage int
SET @StartPage=@PageNumber*@PageSize-@PageSize+1
SET @EndPage=@PageNumber*@PageSize
SELECT *
   FROM orders ord
 ORDER BY ord.orderid
OFFSET @PageNumber*@PageSize-@PageSize ROWS
FETCH NEXT @PageNumber*@PageSize ROWS ONLY

--First_value and Last_Value
SELECT cust.CustomerID,
       cust.CompanyName,
       ord.OrderDate,
       First_Value(ord.OrderDate) over(PARTITION BY cust.companyname
                                ORDER BY (select 1)) [FirstOrderDate],
       Last_Value(ord.OrderDate) over(PARTITION BY cust.companyname
                                ORDER BY (select 1)) [LastOrderDate]
FROM orders ord
INNER JOIN Customers cust ON ord.CustomerID=cust.CustomerID 

WITH CTE AS
  (SELECT cust.CustomerID,
          cust.CompanyName,
          ord.OrderDate,
          LEAD(ord.OrderDate) over(PARTITION BY cust.companyname
                                   ORDER BY ord.orderdate) [NextOrderDate],
                              LAG(ord.OrderDate) over(PARTITION BY cust.companyname
                                                      ORDER BY ord.orderdate) [PreviousOrderDate]
   FROM orders ord
   INNER JOIN Customers cust ON ord.CustomerID=cust.CustomerID)
,
CTE2
AS(
SELECT CustomerID,CompanyName,AVG(NextDateDifference) [AvgDiff]
,IIF(AVG(NextDateDifference)<30,'1',IIF(AVG(NextDateDifference)>=30 and AVG(NextDateDifference)<90,'2',
IIF(AVG(NextDateDifference)>=90,'3','4'))) AS [Tag]
 FROM (SELECT CustomerID,
       CompanyName,
       ISNULL(DATEDIFF(dd,OrderDate,isnull(NextOrderDate,OrderDate)),0) [NextDateDifference],
       ISNULL(DATEDIFF(dd,isnull(PreviousOrderDate,OrderDate),OrderDate),0) [PreviousDateDifference],
       OrderDate,
       NextOrderDate,
       PreviousOrderDate FROM CTE) t
GROUP BY CustomerID,CompanyName
)
SELECT customerid,CompanyName,AvgDiff,
CHOOSE([Tag],'Important','Recommended','Normal','Ignore') [Flag]
 from CTE2

--iif and choose
 select iif(1=2,'a','b')
 select choose(3,'hello','friend','ghost')
 declare @var1 varchar(10),@var2 varchar(10)
 set @var1='Best'
 set @var2=null
 select @var1 + ' ' + @var2,concat(@var1,' ',@var2)

 --Complex Match Join
 SELECT * INTO #CITY FROM
(
SELECT 1 AS ID,'ind'  CITY
UNION ALL
SELECT 2 AS ID,'aus'  CITY
UNION ALL
SELECT 3 AS ID,'sri'  CITY
UNION ALL
SELECT 4 AS ID,'Eng'  CITY
)VW
select * from #CITY
SELECT c.id fromid,c.city fromcity,c1.id toid,c1.city tocity
INTO #team
FROM #CITY c
INNER JOIN #CITY c1 ON c.id <> c1.id
select * from #team
SELECT c.* FROM #team c
INNER JOIN #team c1 ON c.fromid = c1.toid AND c.toid = c1.fromid AND c1.fromid <=c1.toid
ORDER BY c.tocity
drop table #CITY
drop table #team

--Second Highest Salary
declare @n int;
set @n=2;
Select e1.*
from Employee e1 where (@n-1)=(Select COUNT(distinct salary) from Employee e2 where e2.Salary>e1.Salary);

--Second Highest Salary Department Wise
;WITH DepartmentWiseSalary AS
(
    SELECT    *,DENSE_RANK() OVER(PARTITION BY Department ORDER BY Salary DESC) AS RowNum
    FROM    Employee
)
SELECT    *
FROM    DepartmentWiseSalary
WHERE    RowNum = 2;
--Getting All Level Child
;WITH cteEmployee (EmpId, FirstName, LastName, ManagerID, Level)
AS
(
    SELECT    EmpId, FirstName, LastName, ManagerID, 0 AS Level
    FROM    Employee
    WHERE    ManagerID = 2
   
    UNION ALL
   
    SELECT    e.EmpId, e.FirstName, e.LastName, e.ManagerID, Level + 1
    FROM    Employee e
            INNER JOIN cteEmployee AS d ON e.ManagerID = d.EmpId
)
SELECT    EmpId, FirstName, LastName, ManagerID,Level
FROM    cteEmployee;

--Finding Duplicates Record
WITH CTE
AS
(
SELECT ROW_NUMBER() OVER(ORDER BY (Select 1)) [RowNum],* FROM EMPLOYEE
)
SELECT * FROM CTE c1
WHERE
1<(SELECT count(c2.RowNum) FROM CTE c2 WHERE c1.EmpId=c2.EmpId)

--PIVOT Count of employee joining as per YEAR
SELECT    *
FROM  
        (
          SELECT    Department,
                    YEAR(DOJ) AS [Year],
                    COUNT(EmpId) AS [EmployeeCount]
          FROM        Employee
          GROUP BY    Department, YEAR(DOJ)
        ) TT
        PIVOT
        (
              SUM([EmployeeCount])
              FOR [Year] IN ([2006],[2007],[2008],[2009],[2010],[2011])
        ) PT
--Count SPACE
DECLARE     @strName VARCHAR(1000)
SET        @strName = ' White Space is where the world and all distraction falls away '
PRINT        (LEN(@strName) - LEN(REPLACE(@strName, ' ', '')))
PRINT        (DATALENGTH(@strName) - DATALENGTH(REPLACE(@strName, ' ', '')))

--Optimize Below Query
SELECT        *
FROM        Student AS S
WHERE        DOB IN
            (
                SELECT        MAX(DOB)
                FROM        Student sp
                WHERE        YEAR(S.DOB) = YEAR(sp.DOB)
                GROUP BY    YEAR(sp.DOB)
            )
ORDER BY    DOB
--Optimized Query
WITH CTE
AS
(
SELECT        YEAR(DOB) [Year],max(DOB) [DOB]
                FROM        Student sp
                GROUP BY YEAR(DOB)
)
SELECT        *
FROM        Student AS S
join CTE ON        s.DOB =CTE.DOB

Thursday, August 15, 2019

Cache Implementations in C# .NET

One of the most commonly used patterns in software development is Caching. It’s a simple, but a very effective concept. The idea is to reuse operation results. When performing a heavy operation, we will save the result in our cache container. The next time that we need that result, we will pull it from the cache container, instead of performing the heavy operation again.
For example, to get a person’s Avatar you might need a trip to the database. Instead of performing that trip every time, we will save that Avatar in the cache, pulling it from memory every time you need it.
Caching works great for data that changes infrequently. Or even better, never changes. Data that constantly changes, like the current machine’s time shouldn’t be cached or you will get wrong results.

In-process Cache, Persistant in-process Cache, and Distributed Cache

There are 3 types of caches:
  • In-Memory Cache is used for when you want to implement cache in a single process. When the process dies, the cache dies with it. If you’re running the same process on several servers, you will have a separate cache for each server.
  • Persistent in-process Cache is when you back up your cache outside of process memory. It might be in a file, or in a database. This is more difficult, but if your process is restarted, the cache is not lost. Best used when getting the cached item is expansive, and your process tends to restart a lot.
  • Distributed Cache is when you want to have shared cache for several machines. Usually, it will be several servers. With a distributed cache, it is stored in an external service. This means if one server saved a cache item, other servers can use it as well. Services like Redis are great for this.

in-process cache:



https://www.nuget.org/packages/Microsoft.Extensions.Caching.Memory/

Microsoft.Extensions.Caching.Memory





public class WaitToFinishMemoryCache<TItem>
{
    private MemoryCache _cache = new MemoryCache(new MemoryCacheOptions());
    private ConcurrentDictionary<object, SemaphoreSlim> _locks = new ConcurrentDictionary<object, SemaphoreSlim>();

    public async Task<TItem> GetOrCreate(object key, Func<Task<TItem>> createItem)
    {
        TItem cacheEntry;

        if (!_cache.TryGetValue(key, out cacheEntry))// Look for cache key.
        {
            SemaphoreSlim mylock = _locks.GetOrAdd(key, k => new SemaphoreSlim(1, 1));

            await mylock.WaitAsync();
            try
            {
                if (!_cache.TryGetValue(key, out cacheEntry))
                {
                    // Key not in cache, so get data.
                    cacheEntry = await createItem();
                    _cache.Set(key, cacheEntry);
                }
            }
            finally
            {
                mylock.Release();
            }
        }
        return cacheEntry;
    }
}

Usage:
var _avatarCache = new WaitToFinishMemoryCache<byte[]>();
// ...
var myAvatar =

await _avatarCache.GetOrCreate(userId, async () => await _database.GetAvatar(userId));





With this, when trying to get an item, if the same item is in the middle of being created by another thread, you will wait for the other to finish first. Then, you will get the already cached item created by the other thread.

Friday, April 5, 2019

.NET Framework , Visual studio and c# versions

Overview of .NET Framework release history
Version
number
CLR
version
Release
date
Support
ended
Development tool
Included in
Replaces

Windows
Windows Server

1.0
1.0
2002-02-13
2009-07-14
Visual Studio .NET
XP SP1
N/A
N/A

1.1
1.1
2003-04-24
2015-06-14
Visual Studio .NET 2003
XP SP2, SP3
2003
1.0

2.0
2.0
2005-11-07
2011-07-12
Visual Studio 2005
N/A
20032003 R22008 SP22008 R2 SP1
N/A

3.0
2.0
2006-11-06
2011-07-12
Expression Blend
Vista
2008 SP22008 R2 SP1
2.0

3.5
2.0
2007-11-19
2028-10-10
Visual Studio 2008
788.110
2008 R2 SP1
2.0, 3.0

4.0
4
2010-04-12
2016-01-12
Visual Studio 2010
N/A
N/A
N/A

4.5
4
2012-08-15
2016-01-12
Visual Studio 2012
8
2012
4.0

4.5.1
4
2013-10-17
2016-01-12
Visual Studio 2013
8.1
2012 R2
4.0, 4.5

4.5.2
4
2014-05-05
N/A
N/A
N/A
N/A
4.0–4.5.1

4.6
4
2015-07-20
N/A
Visual Studio 2015
10 v1507
N/A
4.0–4.5.2

4.6.1
4
2015-11-30
N/A
Visual Studio 2015 Update 1
10 v1511
N/A
4.0–4.6

4.6.2
4
2016-08-02
N/A
10 v1607
2016
4.0–4.6.1

4.7
4
2017-04-05
N/A
Visual Studio 2017
10 v1703
N/A
4.0–4.6.2

4.7.1
4
2017-10-17
N/A
Visual Studio 2017
10 v1709
2016 v1709
4.0–4.7

4.7.2
4
2018-04-30
N/A
Visual Studio 2017
10 v1803
2019
4.0–4.7.1

4.8
4
2019-04-18
N/A
Visual Studio 2019 
10 v1903 
N/A
4.0–4.7.2


Visual Studio History:
Product nameCodenameVersion
number
Supported .NET
Framework versions
Supported .NET
Core versions
Release date
Visual Studio 2019Dev1616.03.5 - 4.82.1, 2.2, 3.0, 3.1April 2, 2019 
Visual Studio 2017Dev1515.03.5 – 4.71.0-1.1, 2.0March 7, 2017
Visual Studio 2015Dev1414.02.0 – 4.61.0July 20, 2015
Visual Studio 2013Dev1212.02.0 – 4.5.2N/AOctober 17, 2013
Visual Studio 2012Dev1111.02.0 – 4.5.2N/ASeptember 12, 2012
Visual Studio 2010Dev10Rosario10.02.0 – 4.0N/AApril 12, 2010
Visual Studio 2008Orcas9.02.0, 3.0, 3.5N/ANovember 19, 2007
Visual Studio 2005Whidbey8.02.0, 3.0N/ANovember 7, 2005
Visual Studio .NET 2003Everett7.11.1N/AApril 24, 2003
Visual Studio .NET (2002)Rainier7.01.0N/AFebruary 13, 2002
Visual Studio 6.0Aspen6.0N/AN/AJune 1998
Visual Studio 97Boston5.0N/AN/AFebruary 1997
C# Version History:


VersionLanguage specificationDate.NET VersionVisual Studio
EcmaISO/IECMicrosoft
Version C# 1.0December 2002April 2003January 2002January 2002.NET Framework 1.0Visual Studio .NET 2002
Version C# 1.1
C# 1.2
October 2003April 2003.NET Framework 1.1Visual Studio .NET 2003
Version C# 2.0June 2006September 2006September 2005November 2005.NET Framework 2.0
.NET Framework 3.0
Visual Studio 2005
Visual Studio 2008
Version C# 3.0NoneAugust 2007November 2007.NET Framework 2.0 (Except LINQ)
.NET Framework 3.0 (Except LINQ)
.NET Framework 3.5
Visual Studio 2008
Version C# 4.0April 2010April 2010.NET Framework 4Visual Studio 2010
Version C# 5.0December 2017December 2018June 2013August 2012.NET Framework 4.5Visual Studio 2012
Visual Studio 2013
Version C# 6.0NoneDraftJuly 2015.NET Framework 4.6
.NET Core 1.0
.NET Core 1.1
Visual Studio 2015
Version C# 7.0Specification proposalMarch 2017.NET Framework 4.7Visual Studio 2017 version 15.0
Version C# 7.1Specification proposalAugust 2017.NET Core 2.0Visual Studio 2017 version 15.3[41]
Version C# 7.2Specification proposalNovember 2017Visual Studio 2017 version 15.5[42]
Version C# 7.3Specification proposalMay 2018.NET Core 2.1
.NET Core 2.2
.NET Framework 4.8
Visual Studio 2017 version 15.7
Version C# 8Specification proposalSeptember 2019.NET Core 3.0Visual Studio 2019 version 16.3

New features
C# 2.0
·       Generics
·       Partial types
·       Anonymous methods
·       Iterators
·       Nullable types
·       Getter/setter separate accessibility
·       Method group conversions (delegates)
·       Co- and Contra-variance for delegates
·       Static classes
·       Delegate inference
C# 3.0
·       Implicitly typed local variables
·       Object and collection initializers
·       Auto-Implemented properties
·       Anonymous types
·       Extension methods
·       Query expressions
·       Lambda expression
·       Expression trees
·       Partial methods
C# 4.0
·       Dynamic binding
·       Named and optional arguments
·       Generic co- and contravariance
·       Embedded interop types ("NoPIA")[
C# 5.0
·       Asynchronous methods
·       Caller info attributes
C# 6.0
·       Compiler-as-a-service (Roslyn)
·       Import of static type members into namespace
·       Exception filters
·       Await in catch/finally blocks
·       Auto property initializers
·       Default values for getter-only properties
·       Expression-bodied members
·       Null propagator (null-conditional operator, succinct null checking)
·       String interpolation
·       nameof operator
·       Dictionary initializer
C# 7.0
·       Out variables
·       Pattern matching
·       Tuples
·       Deconstruction
·       Local functions
·       Digit separators
·       Binary literals
·       Ref returns and locals
·       Generalized async return types
·       Expression bodied constructors and finalizers
·       Expression bodied getters and setters
·       Throw can also be used as expression
C# 7.1
·       Async main
·       Default literal expressions
·       Inferred tuple element names
C# 7.2
·       Reference semantics with value types
·       Non-trailing named arguments
·       Leading underscores in numeric literals
·       private protected access modifier
C# 7.3
·       Accessing fixed fields without pinning
·       Reassigning ref local variables
·       Using initializers on stackalloc arrays
·       Using fixed statements with any type that supports a pattern
·       Using additional generic constraints
C# 8.0
·       Asyn IEnumeralbe
·       Index and Range
·       Nullability
·       Switch expression
Here is a list of C# 8.0 features, from recent preview releases:
  • Nullable reference types: design with intent, decide that some variables must always have a value, while others may be missing a value, using nullable reference types.
  • Asynchronous streams: create and consume async streams, e.g. large streams of data
  • Indices and ranges: Specify subranges of data with Span<T>, indicate indices in the subsets of data
  • Pattern matching enhancements:
    • Switch expressions: replace repetitive switch-case blocks with simpler switch expressions
    • Property patterns: enhance switch statements by matching an object’s properties
    • Tuple patterns: use tuples for cases when matching sets of values
    • Positional patterns: used to simplify the way we apply recursive patterns without having to name an object’s properties
  • Using declarations: used to simplify using blocks (within which an object is disposed when done) by disposing of the object at the end of the enclosing scope, i.e. its parent block.
  • Static local functions: useful for local methods that are intended to be static.
  • Disposable ref structs: allows the use of Dispose() methods to allow implementation of IDisposable in structs declared with a ref modifier.
----------------------------------------------------------------------------------------------------------------------



Before .NET Standard:

After .NET Standard:

.NET Core

.NET Core is a free and open-source managed computer software framework for the Windows, Linux, and macOS operating systems.

.NET Core 1.0 – June 27, 2016
.NET Core 1.0.4 and .NET Core 1.1.1  – March 7, 2017.
.NET Core 2.0 – August 14, 2017
.NET Core 2.1 – May 30, 2018
.NET Core 2.2 – December 4, 2018.
.NET Core 3 – Septemeber 23,2019
.NET Core 3 the framework will get support for development of desktop application software, artificial intelligence/machine learning and IoT apps.

.NET Core 3.1 - 2019-12-03 - Visual Studio 2019 Version 16.4

.NET 5 - 2020-11 (projected)



ASP.NET Core

ASP.NET Core is a free and open-source web framework, and higher performance than ASP.NET,developed by Microsoft and the community. It is a modular framework that runs on both the full .NET Framework, on Windows, and the cross-platform.


Version NumberRelease DateEnd of SupportSupported Visual Studio Version(s)
1.02016-06-272019-06-27Visual Studio 2015, 2017
1.12016-11-182019-06-27Visual Studio 2015, 2017
2.02017-08-142018-10-01Visual Studio 2017
2.1 Long-term support2018-05-302021-08-21Visual Studio 2017
2.22018-12-042019-12-23Visual Studio 2017 15.9 and 2019 16.0 preview 1
3.02019-09-232020-03-03Visual Studio 2017 and 2019
3.1 Long-term support2019-12-03Visual Studio 2019

ASP.NET MVC

Date
Version
10 December 2007
ASP.NET MVC CTP
13 March 2009
ASP.NET MVC 1.0
16 December 2009
ASP.NET MVC 2 RC
4 February 2010
ASP.NET MVC 2 RC 2
10 March 2010
ASP.NET MVC 2
6 October 2010
ASP.NET MVC 3 Beta
9 November 2010
ASP.NET MVC 3 RC
10 December 2010
ASP.NET MVC 3 RC 2
13 January 2011
ASP.NET MVC 3
20 September 2011
ASP.NET MVC 4 Developer Preview
15 February 2012
ASP.NET MVC 4 Beta
31 May 2012
ASP.NET MVC 4 RC
15 August 2012
ASP.NET MVC 4
30 May 2013
ASP.NET MVC 4 4.0.30506.0
26 June 2013
ASP.NET MVC 5 Preview
23 August 2013
ASP.NET MVC 5 RC 1
17 October 2013
ASP.NET MVC 5
17 January 2014
ASP.NET MVC 5.1
10 February 2014
ASP.NET MVC 5.1.1
4 April 2014
ASP.NET MVC 5.1.2
22 June 2014
ASP.NET MVC 5.1.3
1 July 2014
ASP.NET MVC 5.2.0
28 August 2014
ASP.NET MVC 5.2.2
9 February 2015
ASP.NET MVC 5.2.3
12 February 2018
ASP.NET MVC 5.2.4
2 May 2018
ASP.NET MVC 5.2.5
11 May 2018
ASP.NET MVC 5.2.6
29 November 2018
ASP.NET MVC 5.2.7
6 November 2014
ASP.NET MVC 6.0.0-beta1
18 November 2015
ASP.NET MVC 6.0.0-rc1


ASP.NET Core MVC - Release history
DateVersion
17 May 2016ASP.NET Core MVC 1.0.0-rc2
12 August 2016ASP.NET Core MVC 1.0.0
17 August 2016ASP.NET Core MVC 1.0.1
17 November 2016ASP.NET Core MVC 1.0.2
6 March 2017ASP.NET Core MVC 1.0.3
9 May 2017ASP.NET Core MVC 1.0.4
20 September 2017ASP.NET Core MVC 1.0.5
14 November 2016ASP.NET Core MVC 1.0.6
16 November 2016ASP.NET Core MVC 1.1.0
27 January 2017ASP.NET Core MVC 1.1.1
6 March 2017ASP.NET Core MVC 1.1.2
9 May 2017ASP.NET Core MVC 1.1.3
20 September 2017ASP.NET Core MVC 1.1.4
14 November 2017ASP.NET Core MVC 1.1.5
12 December 2017ASP.NET Core MVC 1.1.6
13 March 2018ASP.NET Core MVC 1.1.7
11 August 2017ASP.NET Core MVC 2.0.0
14 November 2017ASP.NET Core MVC 2.0.1
9 January 2018ASP.NET Core MVC 2.0.2
13 March 2018ASP.NET Core MVC 2.0.3
30 May 2018ASP.NET Core MVC 2.1.0
18 June 2018ASP.NET Core MVC 2.1.1
4 December 2018ASP.NET Core MVC 2.2.0
29 September 2019ASP.NET Core MVC 3.0.0
3 December 2019ASP.NET Core MVC 3.1.0
14 January 2020ASP.NET Core MVC 3.1.1
Entity Framework History

Entity Framework 6.2.0 - Release Date: Oct 26, 2017

Entity Framework 6.1.3 - Release Date: Mar 10, 2015

Entity Framework 6.1.2 - Release Date: Jan 22, 2015

Entity Framework 6.1.1 - Release Date: Oct 22, 2014

Entity Framework 6.1.0 -Release Date: Apr 30, 2014

Entity Framework 6.0.2 - Release Date: Apr 30, 2014

Entity Framework 6.0.1-Release Date: Oct 28, 2013

Entity Framework 6.0.0-Release Date: Oct 17, 2013

Entity Framework 5.0.0-Release Date: Nov 08, 2012

Entity Framework 4.3.1-Release Date: Feb 29, 2012

Entity Framework 4.3.0-Release Date: Feb 09, 2012

Entity Framework 4.2.0-Release Date: Nov 01, 2011

Entity Framework 4.1.1-Release Date: Jul 25, 2011

Entity Framework 4.1-Release Date: Apr 12, 2011

Entity Framework 4-Release Date: Apr 12, 2011

EF or EF3.5 -Release Date: Aug 11, 2008


Entity Framework Core Version History


Release                Target framework           Supported until
EF Core 3.1          .NET Standard 2.0             December 3, 2022 (LTS)
EF Core 3.0          .NET Standard 2.1             Expired March 3, 2020   
EF Core 2.2          .NET Standard 2.0             Expired December 23, 2019         
EF Core 2.1          .NET Standard 2.0             August 21, 2021 (LTS)    
EF Core 2.0          .NET Standard 2.0             Expired October 1, 2018               
EF Core 1.1          .NET Standard 1.3             Expired June 27 2019     
EF Core 1.0          .NET Standard 1.3             Expired June 27 2019      


ASP.NET Web API Releases

·       Web API OData 5.3
·       ASP.NET Web API 2.2
·       ASP.NET Web API 2.1

Microsoft.AspNet.WebApi  - Nuget packages

Version
Downloads
Last updated
5.2.7
632,215
4 months ago
5.2.6
2,132,306
5/11/2018
5.2.5
172,871
5/2/2018
5.2.5-preview1
11,910
3/19/2018
5.2.4
1,673,657
2/12/2018
5.2.4-preview1
16,732
1/5/2018
5.2.3
20,520,483
2/9/2015
5.2.3-beta1
41,574
12/17/2014
5.2.2
2,701,783
8/28/2014
5.2.2-rc
24,025
8/23/2014
5.2.0
1,235,467
7/1/2014
5.2.0-rc
42,397
5/27/2014
5.1.2
919,824
4/2/2014
5.1.1
580,874
2/10/2014
5.1.0
388,160
1/17/2014
5.1.0-rc1
32,354
12/6/2013
5.0.1
296,351
2/13/2014
5.0.0
1,716,757
10/17/2013
5.0.0-rc1
48,381
8/23/2013
5.0.0-beta2
42,068
6/26/2013
5.0.0-beta1
25,577
6/26/2013
4.0.30506
5,509,892
5/30/2013
4.0.20710
3,195,844
8/11/2012
4.0.20505
208,520
5/31/2012

SQL Server release history
Version
Year
Release name
Code name
Internal database version
1.0 (OS/2)
1989
SQL Server 1.0 (16-bit)
Filipi
-
1.1 (OS/2)
1990
SQL Server 1.1 (16-bit)
Pietro
-
4.2A (OS/2)
1992
SQL Server 4.2A (16-bit)
-
-
4.2B (OS/2)
1993
SQL Server 4.2B (16-bit)
-
-
4.21a (WinNT)
1993
SQL Server 4.21a
SQLNT
-
6.0
1995
SQL Server 6.0
SQL95
406
6.5
1996
SQL Server 6.5
Hydra
408
7.0
1998
SQL Server 7.0
Sphinx
515
-
1999
SQL Server 7.0 OLAP Tools
Plato
-
8.0
2000
SQL Server 2000
Shiloh
539
8.0
2003
SQL Server 2000 64-bit Edition
Liberty
539
9.0
2005
SQL Server 2005
Yukon
611/612
10.0
2008
SQL Server 2008
Katmai
655
10.25
2010
Azure SQL database (initial release)
Cloud database or CloudDB
10.50
2010
SQL Server 2008 R2
Kilimanjaro (aka KJ)
661
11.0
2012
SQL Server 2012
Denali
706
12.0
2014
SQL Server 2014
SQL14
782
13.0
2016
SQL Server 2016
SQL16
852
14.0
2017
SQL Server 2017
Helsinki
869
15.0
2019
SQL Server 2019 RC
Seattle
895
Old version
Older version, still supported
Latest version


BizTalk Server History

Starting in 2000, the following versions were released:
·       2000-12-01 BizTalk Server 2000
·       2002-02-04 BizTalk Server 2002
·       2004-03-02 BizTalk Server 2004 (First version to run on Microsoft .NET 1.0)
·       2006-03-27 BizTalk Server 2006 (First version to run on Microsoft .NET 2.0)
·       2007-10-02 BizTalk Server 2006 R2 (First version to utilize the new Windows Communication Foundation (WCF) via native adapter - (Release date 2 October 2007))
·       2010-04-27 BizTalk Server 2009 (First version to work with Visual Studio 2008)
·       2010-10-01 BizTalk Server 2010 (First version to work with Visual Studio 2010 and Microsoft .NET 4.0)
·       2013-03-21 BizTalk 2013 (First version to work with Visual Studio 2012 and Microsoft .NET 4.5)
·       2014-06-23 BizTalk 2013 R2 (First version to work with Visual Studio 2013 and Microsoft .NET 4.5.1)
·       2016-09-30 BizTalk Server 2016
·       2017-04-26 BizTalk Server 2016 Feature Pack 1 (Application Insights and Power BI integration; Swagger-compatible REST APIs)
·       2017-11-21 BizTalk Server 2016 Feature Pack 2 (Azure integration)
·       2018-06-26 BizTalk Server 2016 Feature Pack 3 (Office 365 integration) 
·      2020-01-15 BizTalk Server 2020 (First version to work with Visual Studio 2019 and Microsoft .NET 4.7)

Encrypt/Decrypt the App.Config

Program.cs using System; using System.Diagnostics; using System.IO; namespace EncryptAppConfig {     internal class Program     {         pr...