Skip to content

Chapter 15: Making controller action methods asynchronous #96

@Dreamoochy

Description

@Dreamoochy

Sorry if I've missed something again. There's a code on the page 663:

HomeIndexViewModel model = new
(
  VisitorCount = (new Random()).Next(1, 1001),
  Categories = await db.Categories.ToListAsync(),
  Products = await db.Products.ToListAsync()
);

With = symbols I get CS0103 errors. Replacing them with : solves the problem:

HomeIndexViewModel model = new
(
  VisitorCount : (new Random()).Next(1, 1001),
  Categories : await db.Categories.ToListAsync(),
  Products : await db.Products.ToListAsync()
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions