16 errors in anonymous type code

Zypex 1 Reputation point
2021-08-25T00:45:31.71+00:00

Hello, I am very new to C# and i'm trying to learn it better. Right now I am very stuck at these certain lines. Ive got 16 errors in total which are all in this certain area. I appreciate any help and there is a a list of all the code errors in correct line

    {
        var source = new <>f__AnonymousType0<string, int, int>[]
        {
            new
            {
                Name = "FAT32",
                NameOffs = 82,
                SerialOffs = 67
            },
            new
            {
                Name = "FAT",
                NameOffs = 54,
                SerialOffs = 39
            },
            new
            {
                Name = "NTFS",
                NameOffs = 3,
                SerialOffs = 72
            }
        };
        using (Helpers.Disk disk = new Helpers.Disk(volume))
        {
            byte[] sector = new byte[512];
            disk.ReadSector(0U, sector);
            var <>f__AnonymousType = source.FirstOrDefault(f => Helpers.Strncmp(f.Name, sector, f.NameOffs));
            if (<>f__AnonymousType == null)
            {
                throw new NotSupportedException("This file system is not supported");
            }
            uint num = newSerial;
            int i = 0;
            while (i < 4)
            {
                sector[<>f__AnonymousType.SerialOffs + i] = (byte)(num & 255U);
                i++;
                num >>= 8;
            }
            disk.WriteSector(0U, sector);
        }
    }

CS1061
CS1002
CS1002
CS1002
CS1002
CS1526
CS1525
CS1525
CS1525
CS1525
CS1525
CS0443
CS0103
CS0246
CS1513
CS1513

Windows 10 Compatibility
Windows 10 Compatibility
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Compatibility: The extent to which hardware or software adheres to an accepted standard.
459 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 39,426 Reputation points
    2021-08-25T10:59:14.937+00:00

    Hello @Zypex ,

    Thank you for your question.

    Please go through this link it has the solution of your 16 errors. In the link you'll see table of contents there you can see all the code CS1061 and others

    https://learn.microsoft.com/en-us/dotnet/csharp/misc/cs1007

    If the reply was helpful,please don't forget to upvote or accept as answer.

    Thanks,

    Aradhya C

    0 comments No comments