DOT NET Core 3 announced

It will support now Windows desktop application

* Windows Forms
* Windows Presentation Framework (WPF)
* Universal Windows Platform (UWP) XAML

Benefits of .NET Core for Desktop

* Performance improvements and other runtime updates
* Very easy to use and/or test
* Machine-global and application-local deployment
* .NET Core CLI tools and SDK-style projects

Preview could come in year-end 2018
And the final version in early 2019

For more details visit:

https://blogs.msdn.microsoft.com/dotnet/2018/05/07/net-core-3-and-support-for-windows-desktop-applications/


Other links:

https://blogs.msdn.microsoft.com/dotnet/2018/04/18/performance-improvements-in-net-core-2-1/

C# custom validation ValidationAttribute

Using theĀ ValidationAttribute we can handle custom validation. It is available in namespace: System.ComponentModel.DataAnnotations Below is snippet for the same here age is being evaluated.

public class AgeValidator : ValidationAttribute
{
  public int Age { get; set; }

  public override bool IsValid(object value)
  {
    DateTime dob;
    if (value != null
       && DateTime.TryParse(value.ToString(), out dob))
    {
      if (dob.AddYears(Age) <= DateTime.Now)
      {
        return true;
      }
    }
    return false;
  }
}