Friday, May 8, 2020

What does the [EnumMember] attribute do in C#?

Meh. It allows that which is serializable to be deserialized as an enum.

using System.Runtime.Serialization;
namespace Ecs.Domain.Health.Web.Models
{
   [DataContract(Name = "mode", Namespace =
         Namespaces.PrtgModelsNamespace)]
   public enum PrtgModeType
   {
      [EnumMember]
      Absolute,
      [EnumMember]
      Difference
   }
}

Wednesday, May 6, 2020

Microsoft.Extensions.Configuration

More random extensions stuff... This may come into play when migrating from .NET Framework to .NET Core.

Tuesday, May 5, 2020

What uses a IComponentRegistryBuilder?

This is Autofac stuff. I found a library online that has ComponentRegistryBuilder implementing both IDisposable and IComponentRegistryBuilder. I'd stop now, but I wanted to mention that this was inside:

public event EventHandler<ComponentRegisteredEventArgs> Registered
{
   add
   {
      lock (_synchRoot)
      {
         Properties["x"] = GetRegistered() + value;
      }
   }
   
   remove
   {
      lock (_synchRoot)
      {
         Properties["x"] = GetRegistered() - value;
      }
   }
}

 
 

At the top of the file, _synchRoot is defined like so:

private readonly object _synchRoot = new object();

Saturday, May 2, 2020

zone/NgZone in Angular

This shows up on page 468 of ASP.NET Core 2 and Angular 5 by Valerio De Sanctis and is explained to be a thread encapsulation for JavaScript in Angular. Whenever something has to be tracked back Angular uses these unseen and you should really roll these out too. When talking in from the outside, use a zone.

Friday, May 1, 2020

System.StackOverflowException

we are doing too much

.Primatives

This requires that System.ServiceModel.Primatives be installed:

var serviceClient = client as ClientBase<FNCEWS40PortType>;

 
 

The thing that is wacky about this is that System.ServiceModel without Primatives may already be installed and System.ServiceModel.Primatives uses the same using statement without the .Primatives on the end.