Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CS 7036 Error Even without Base Class Inheritance #17

Closed
ramjet69 opened this issue Sep 11, 2021 · 3 comments
Closed

CS 7036 Error Even without Base Class Inheritance #17

ramjet69 opened this issue Sep 11, 2021 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@ramjet69
Copy link

ramjet69 commented Sep 11, 2021

Hello,

I am unable to figure out why I am getting a CS7036 on even the most basic model when using the Fluent Set.

Here is my model:

public class ConfirmUserEmailViewModel
{
    public string Name { get; set; }
    public string ConfirmUrl { get; set; }
}

Here is my razor:

<p>Welcome @Model.Name,</p>
<p>Please confirm your email by <a href='@Model.ConfirmUrl'>clicking here</a>.</p>
<p>If you prefer you can copy and paste this link into your browser of choice.</p>
<br />
<p>@Model.ConfirmUrl</p>
<br />

@code {
    [Parameter] public ConfirmUserEmailViewModel Model { get; set; }
}

image

What am I doing wrong?

TIA

@conficient
Copy link
Owner

I've often made this mistake too myself! The setter syntax is .Set(x => x.Property, Value) - note the comma not equals

So change your code to

var viewResult = new ComponentRenderer<ConfirmUserEmail>()
   .Set(x => x.Model, viewModel)
  .Render();

That should do it

@conficient conficient self-assigned this Sep 11, 2021
@conficient conficient added the question Further information is requested label Sep 11, 2021
@conficient
Copy link
Owner

Just realised this was my error in my answer on your StackOverflow question - apologies for misleading you!

@ramjet69
Copy link
Author

@conficient No Worries!

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants