✅ Connection razor and cs class
I'm trying to connect my razor using .NET MAUI Blazor so I'm trying to connect it to the cs class "Customer" so I can use the property there. I already used the @using "the namespace"

19 Replies
the error seems very clear, what is your Customer class

the customer used in here is not the same
if you hover your mouse over it and go to definition it should tell you which one its using
Okay thanks!
also are you sure id is supposed to be a string and not a GUID or int
yeah for now I'm keeping it as string
ok its saying this

and then looking here

so you either referenced the wrong class or something else
hmm maybe Im somehow referencing the class inside itself
and i made sure to do this

can you show the full code
FRICK
I GOT I
T
so what I did was change my class name to customers with an s
then in the razor I change the list name to that too
for some reason customer was buggin
they are conflicting with each other's name that is not a good way to solve the problem
ideally you would fully qualify the name
but I would prefer to use a viewmodel for the page instead
https://learn.microsoft.com/en-us/aspnet/core/razor-pages/?view=aspnetcore-9.0&tabs=visual-studio
Yeah and I also have a databasebroker class that has a list<customer>
ok
which makes it even more interesting to use a viewmodel instead
the link above explain how it works
thank you 🙏 i'll read over it
$close
If you have no further questions, please use /close to mark the forum thread as answered