Can I use C# 9 records as IOptions?

Is there any way to configure the IOptions configuration system to deserialize the options using the record’s constructor instead of requiring a parameterless constructor? No, in general ASP.Net Core uses a lot of run-time type instancing, which requires constructor calls that are known beforehand, and in this case it requires a constructor with no arguments. … Read more

Is there any way of using Records with inheritance?

The JEP states this: Restrictions on records Records cannot extend any other class, and cannot declare instance fields other than the private final fields which correspond to components of the state description. Any other fields which are declared must be static. These restrictions ensure that the state description alone defines the representation. The Java 17 … Read more

Delphi TList of records

The easiest way is to create your own descendant of TList. Here’s a quick sample console app to demonstrate: program Project1; {$APPTYPE CONSOLE} uses SysUtils, Classes; type PMyRec=^TMyRec; TMyRec=record Value: Integer; AByte: Byte; end; TMyRecList=class(TList) private function Get(Index: Integer): PMyRec; public destructor Destroy; override; function Add(Value: PMyRec): Integer; property Items[Index: Integer]: PMyRec read Get; default; … Read more

OSStatus error 1718449215

1718449215 is the decimal representation of the four character code for the kAudioFormatUnsupportedDataFormatError error. In general you can use something like this to get more information from the errors you receive: NSError *error = [NSError errorWithDomain:NSOSStatusErrorDomain code:my_error_code userInfo:nil]; NSLog(@”Error: %@”, [error description]);