Friendica
Khalid K-1000 🤖

Khalid K-1000 🤖

khalidabuhakmeh@mastodon.social
Khalid K-1000 🤖

Khalid K-1000 🤖

khalidabuhakmeh@mastodon.social

Loves @NicoleAbuhakmeh. #OSS supporter. #software developer. He/Him. Living the simulation lifestyle. #dotnet #java #javascript #html

searchable

ActivityPub
2022-12-08 14:46:39 2022-12-08 14:46:38 2022-12-08 14:44:03 1653142

Khalid K-1000 🤖
Khalid K-1000 🤖
mastodon - Link to source

Khalid K-1000 🤖

2 years ago • •

Khalid K-1000 🤖

2 years ago • •


The new "required" keyword in #csharp 11 and #dotnet 7 are pretty cool.

Force consumers of your object to define values for properties. This helps reduce the need for constructor overloads.

public class Previous
    {
        public string Name { get; }

        public Previous(string name)
        {
            Name = name;
        }
    }

    public class Updated
    {
        public required string Name { get; set; }
    }
#dotnet #csharp
  •  Languages
  •  Search Text
  •  Share via ...
in reply to Khalid K-1000 🤖

Arkadiusz Świętnicki 🇨🇳 I HAVE MOVED
mastodon - Link to source

Arkadiusz Świętnicki 🇨🇳 I HAVE MOVED

in reply to Khalid K-1000 🤖 • 2 years ago • •
FInally! I wish we got something like convenience inits in Swift, where we can make an optional constructor without much hassle.
  •  Languages
  •  Search Text
  •  Share via ...
⇧