jalepi
jalepi
CC#
Created by Frite on 6/16/2024 in #help
How to iterate all classes in a name space ?
Microsoft Visual C# Step by Step, 10th Edition, or newer. Read the book, doing the exercises for each chapter. Proceed to the next chapter once you understood the previous one. Don't skip. One by one, like a good student 😉
15 replies
CC#
Created by reeeeeee on 6/25/2023 in #help
❔ Remove Index from URL
Basically everything is going there 😂
20 replies
CC#
Created by reeeeeee on 6/25/2023 in #help
❔ Remove Index from URL
rubberduck
20 replies
CC#
Created by reeeeeee on 6/25/2023 in #help
❔ Remove Index from URL
It is apparently adding a new route
20 replies
CC#
Created by reeeeeee on 6/25/2023 in #help
❔ Remove Index from URL
There is something wrong with edit's httpget attribute. I don't think is necessary. Try using just [HttpGet] instead, since {id} is set in defaul route...
20 replies
CC#
Created by reeeeeee on 6/25/2023 in #help
❔ Remove Index from URL
Try commenting it out and see what happens
20 replies
CC#
Created by reeeeeee on 6/25/2023 in #help
❔ Remove Index from URL
You definitely can, but easier should be mapping a route without {action} or setting it as default equals to Index.
20 replies
CC#
Created by reeeeeee on 6/25/2023 in #help
❔ Remove Index from URL
Controller, yes
20 replies
CC#
Created by reeeeeee on 6/25/2023 in #help
❔ Remove Index from URL
Without the rest of the code it's difficult to tell
20 replies
CC#
Created by dave1 on 5/19/2023 in #help
❔ How explicitly define command and handlers for MediatR
the different project should expose a public method for adding dependencies to service collection. in the other project, which doesn't know about mediator, you add the dependencies. now the question is how would you send commands to mediator, not knowing MediatR types. you library which knows about MediatR should also expose interface and a concrete type as dependency, to act as a proxy - because you don't want to inject IMediator I assume
21 replies
CC#
Created by Xan.Nava on 5/17/2023 in #help
❔ Who to unify data access within a program.
Check out Mediator
15 replies
CC#
Created by Zeo on 5/16/2023 in #help
❔ Unmockable
To mock a type, it cannot be sealed. To mock a member, it must be abstract (or from interface), or virtual. Best thing for you, is to extract an interface from the class you want to mock.
17 replies
CC#
Created by EliasGPS on 5/13/2023 in #help
✅ Working with repository in ASP.NET
nice, congrats!
17 replies
CC#
Created by EliasGPS on 5/13/2023 in #help
✅ Working with repository in ASP.NET
it seems you are missing registering that dependency. dependency injection registrations are typically done inside Program.cs by services.AddSingleton, or AddTransient or AddScoped
17 replies
CC#
Created by potzko on 5/12/2023 in #help
❔ help with self referential class typing
var self = (Self)Activator.CreateInstance(typeof(Self), item);
9 replies
CC#
Created by Ysehporp on 1/30/2023 in #help
❔ Entity Framework duplicating primary key with seeded data.
It's necessary that both your table AND your data model entity are configured properly. Database, it is specific, you should check their docs. EF is pretty straight forward as well, using model creation with fluent API, or attributes. Also, check their docs.
9 replies
CC#
Created by BasedBee on 1/29/2023 in #help
❔ What is better book for c# mastery? "Pro C# 9 with .NET 5" or "C# 9 and .NET 5"?
Microsoft Visual C# Step by Step, by John Sharp and Microsoft Press. https://www.microsoftpressstore.com/store/microsoft-visual-c-sharp-step-by-step-9780137619832
7 replies
CC#
Created by Ysehporp on 1/30/2023 in #help
❔ Entity Framework duplicating primary key with seeded data.
I assume your database table and your data model entity are both configured as auto increment, right?
9 replies
CC#
Created by Ysehporp on 1/30/2023 in #help
❔ Entity Framework duplicating primary key with seeded data.
If your table has auto increment id, you probably should not inform any id in your seed data while inserting data, only when updating.
9 replies
CC#
Created by POQDavid on 1/28/2023 in #help
❔ Having trouble with binding Dictionary<TKey, TValue>
KeyValuePair is a struct. I don't think update triggers that would work. It would be better if you do the opposite, use an ObservableCollection to hold your values, and expose dictionary interface to manipulate values from outside.
11 replies