workani
workani
CC#
Created by workani on 2/12/2025 in #help
Correct file structure in VSA web API project.
Then different question. Does my structure good enough ?
3 replies
CC#
Created by workani on 1/31/2025 in #help
✅ Why some people don’t like Automapper?
Thanks for answers!
12 replies
CC#
Created by workani on 1/31/2025 in #help
✅ How to avoid creating same CRUD Commands/Queries for different entities | MediatR, ASP.NET
Fair enough, thanks!
54 replies
CC#
Created by workani on 1/31/2025 in #help
✅ How to avoid creating same CRUD Commands/Queries for different entities | MediatR, ASP.NET
+ Generic repository
54 replies
CC#
Created by workani on 1/31/2025 in #help
✅ How to avoid creating same CRUD Commands/Queries for different entities | MediatR, ASP.NET
So the best way is to create commands/handlers for each entity?
54 replies
CC#
Created by workani on 1/31/2025 in #help
✅ How to avoid creating same CRUD Commands/Queries for different entities | MediatR, ASP.NET
I use EFCore + Automapper
54 replies
CC#
Created by workani on 1/31/2025 in #help
✅ How to avoid creating same CRUD Commands/Queries for different entities | MediatR, ASP.NET
Let me ask different question, what are my options to avoid creating CRUD commands/queries each time?
54 replies
CC#
Created by workani on 1/31/2025 in #help
✅ How to avoid creating same CRUD Commands/Queries for different entities | MediatR, ASP.NET
And which exact part of code do you need ?
54 replies
CC#
Created by workani on 1/31/2025 in #help
✅ How to avoid creating same CRUD Commands/Queries for different entities | MediatR, ASP.NET
That would be hard to do, cause I’ve deleted all generic queries/handlers
54 replies
CC#
Created by workani on 1/31/2025 in #help
✅ How to avoid creating same CRUD Commands/Queries for different entities | MediatR, ASP.NET
Most likely, cause I got a bit lost with generics
54 replies
CC#
Created by workani on 1/31/2025 in #help
✅ How to avoid creating same CRUD Commands/Queries for different entities | MediatR, ASP.NET
This lines causes an error
54 replies
CC#
Created by workani on 1/31/2025 in #help
✅ How to avoid creating same CRUD Commands/Queries for different entities | MediatR, ASP.NET
services.AddTransient(typeof(IRequestHandler<,>), typeof(GetAllEntites<,,,>);
54 replies
CC#
Created by workani on 1/31/2025 in #help
✅ How to avoid creating same CRUD Commands/Queries for different entities | MediatR, ASP.NET
The thing is, I’m getting an error after trying to register service with 3 generic parameters
54 replies
CC#
Created by workani on 1/31/2025 in #help
✅ How to avoid creating same CRUD Commands/Queries for different entities | MediatR, ASP.NET
Admin panel for offline book shop
54 replies
CC#
Created by workani on 1/31/2025 in #help
✅ How to avoid creating same CRUD Commands/Queries for different entities | MediatR, ASP.NET
What do you mean ?
54 replies
CC#
Created by workani on 1/31/2025 in #help
✅ How to avoid creating same CRUD Commands/Queries for different entities | MediatR, ASP.NET
I’ve already tried that, but it didn’t work out because I had three generic parameters: class GetById<T, TDto, TId>; and I wasn’t able to register it in the DI.
54 replies
CC#
Created by workani on 1/15/2025 in #help
✅ Implementing delete repository method & controller | Web Api
Thanks
29 replies
CC#
Created by workani on 1/15/2025 in #help
✅ Implementing delete repository method & controller | Web Api
Could you explain please meaning of '_ ='
29 replies
CC#
Created by workani on 1/15/2025 in #help
✅ Implementing delete repository method & controller | Web Api
I like it
29 replies
CC#
Created by workani on 1/15/2025 in #help
✅ Implementing delete repository method & controller | Web Api
So this code is just about fine?
public async Task DeleteByIdAsync(int id)
{
var comment = await context.Comments.FindAsync(id);

context.Comments.Remove(comment!);

await context.SaveChangesAsync();
}
public async Task DeleteByIdAsync(int id)
{
var comment = await context.Comments.FindAsync(id);

context.Comments.Remove(comment!);

await context.SaveChangesAsync();
}
29 replies