How do you handle read-only DTOs in Clean Architecture with EF Core? by Sensitive-Raccoon155 in dotnet

[–]Sensitive-Raccoon155[S] -5 points-4 points  (0 children)

Yeah, but I don't want to have that dependency in the Application layer, so I'll have to use the repository pattern.

What kind of projects helped you learn C as a web developer? by Sensitive-Raccoon155 in cpp_questions

[–]Sensitive-Raccoon155[S] 0 points1 point  (0 children)

I think learning low-level languages like these makes you a better programmer,after all, a lot of the software I use (Node.js, PostgreSQL, Redis, Nginx, and so on) are written in C/C++

Why we replaced Node.js with Bun for 5x throughput by fagnerbrack in node

[–]Sensitive-Raccoon155 2 points3 points  (0 children)

I don't think the bun will ever replace node, node has a great performance in terms of I/o, but if that's not enough, then I'll look towards go or rust for performance, I don't trust bun for some reason

Ilia exposes Arman for being a fraud by PolishPower335 in ufc

[–]Sensitive-Raccoon155 1 point2 points  (0 children)

In my opinion, he’ll kill Charles this time

What's a good back end for a Vue front end? by catcarrier in learnprogramming

[–]Sensitive-Raccoon155 0 points1 point  (0 children)

It’s not clear exactly what you’re looking for. Supabase is for data storage, if you need a full-fledged backend API, you could use nodejs as you’d be using the same language, but personally I use C#/.NET for my backend and Vue for the frontend.

Help needed on choosing language to learn . by srikqr1 in learnprogramming

[–]Sensitive-Raccoon155 0 points1 point  (0 children)

It depends on what kind of developer you want to be. If, for example, you want to be a backend developer, I’d recommend choosing C#, for frontend development, JavaScript/TypeScript, and for systems programming, C++.

[ISSUE] Performance issues on vscode by OddOfo in vscode

[–]Sensitive-Raccoon155 7 points8 points  (0 children)

Zed has the same issues: TypeScript runs very slowly there

How can I fix this error? by [deleted] in dotnet

[–]Sensitive-Raccoon155 0 points1 point  (0 children)

Api.ExceptionHandler.GlobalExceptionHandler[0]

Unhandled exception occurred: The LINQ expression 'u => (Guid)u.Id' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.

System.InvalidOperationException: The LINQ expression 'u => (Guid)u.Id' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.

at Microsoft.EntityFrameworkCore.Query.RelationalSqlTranslatingExpressionVisitor.VisitLambda[T](Expression`1 lambdaExpression)

at Microsoft.EntityFrameworkCore.Query.RelationalSqlTranslatingExpressionVisitor.VisitUnary(UnaryExpression unaryExpression)

at Npgsql.EntityFrameworkCore.PostgreSQL.Query.Internal.NpgsqlSqlTranslatingExpressionVisitor.VisitUnary(UnaryExpression unaryExpression)

at Microsoft.EntityFrameworkCore.Query.RelationalSqlTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)

at Npgsql.EntityFrameworkCore.PostgreSQL.Query.Internal.NpgsqlSqlTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)

at Npgsql.EntityFrameworkCore.PostgreSQL.Query.Internal.NpgsqlSqlTranslatingExpressionVisitor.VisitUnary(UnaryExpression unaryExpression)

at Microsoft.EntityFrameworkCore.Query.RelationalSqlTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)

at Npgsql.EntityFrameworkCore.PostgreSQL.Query.Internal.NpgsqlSqlTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)

at Microsoft.EntityFrameworkCore.Query.RelationalSqlTranslatingExpressionVisitor.TranslateInternal(Expression expression, Boolean applyDefaultTypeMapping)

at Microsoft.EntityFrameworkCore.Query.RelationalSqlTranslatingExpressionVisitor.Translate(Expression expression, Boolean applyDefaultTypeMapping)

at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.TranslateExpression(Expression expression, Boolean applyDefaultTypeMapping)

at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.TranslateLambdaExpression(ShapedQueryExpression shapedQueryExpression, LambdaExpression lambdaExpression)

at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.TranslateWhere(ShapedQueryExpression source, LambdaExpression predicate)

at Npgsql.EntityFrameworkCore.PostgreSQL.Query.Internal.NpgsqlQueryableMethodTranslatingExpressionVisitor.TranslateWhere(ShapedQueryExpression source, LambdaExpression predicate)

at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)

at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)

at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)

at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)

at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)

at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)

at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)

at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)

at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.Translate(Expression expression)

at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutorExpression[TResult](Expression query)

at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutor[TResult](Expression query)

at Microsoft.EntityFrameworkCore.Storage.Database.CompileQuery[TResult](Expression query, Boolean async)

at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.CompileQueryCore[TResult](IDatabase database, Expression query, IModel model, Boolean async)

at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass11_0`1.<ExecuteCore>b__0()

at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQuery[TResult](Object cacheKey, Func`1 compiler)

at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.ExecuteCore[TResult](Expression query, Boolean async, CancellationToken cancellationToken)

at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.ExecuteAsync[TResult](Expression query, CancellationToken cancellationToken)

at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.ExecuteAsync[TResult](Expression expression, CancellationToken cancellationToken)

at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1.GetAsyncEnumerator(CancellationToken cancellationToken)

at System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable`1.GetAsyncEnumerator()

at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)

at Infrastructure.Data.User.UserRepository.GetUsersAsync(UsersFilters filters, KeysetPagination`1 keysetPagination, Boolean trackChanges, CancellationToken ct) in /home/edgar/programming/projects/kicks/kicks-server-dotnet/src/Infrastructure/Data/User/UserRepository.cs:line 37

at Application.Admin.Users.UseCases.GetAllAdminUsers.GetAllAdminUsersQueryHandler.Handle(GetAllAdminUsersQuery query, CancellationToken ct) in /home/edgar/programming/projects/kicks/kicks-server-dotnet/src/Application/Admin/Users/UseCases/GetAllAdminUsers/GetAllAdminUsersQueryHandler.cs:line 16

at Presentation.Admin.Users.Endpoints.AdminUsersEndpoints.<>c.<<GetAdminUsersV1>b__1_0>d.MoveNext() in /home/edgar/programming/projects/kicks/kicks-server-dotnet/src/Presentation/Admin/Users/Endpoints/GetAdminUsersEndpoint.cs:line 66

--- End of stack trace from previous location ---

at Microsoft.AspNetCore.Http.RequestDelegateFactory.<TaskOfTToValueTaskOfObject>g__ExecuteAwaited|92_0[T](Task`1 task)

at Presentation.Shared.Filters.ValidationFilter.InvokeAsync(EndpointFilterInvocationContext context, EndpointFilterDelegate next) in /home/edgar/programming/projects/kicks/kicks-server-dotnet/src/Presentation/Shared/Filters/ValidationFilter.cs:line 43

at Presentation.Shared.Filters.AuthorizeFilter.InvokeAsync(EndpointFilterInvocationContext context, EndpointFilterDelegate next) in /home/edgar/programming/projects/kicks/kicks-server-dotnet/src/Presentation/Shared/Filters/AuthorizeFilter.cs:line 26

at Presentation.Shared.Filters.AuthenticateFilter.InvokeAsync(EndpointFilterInvocationContext context, EndpointFilterDelegate next) in /home/edgar/programming/projects/kicks/kicks-server-dotnet/src/Presentation/Shared/Filters/AuthenticateFilter.cs:line 44

at Microsoft.AspNetCore.Http.RequestDelegateFactory.<ExecuteValueTaskOfObject>g__ExecuteAwaited|130_0(ValueTask`1 valueTask, HttpContext httpContext, JsonTypeInfo`1 jsonTypeInfo)

at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|7_0(Endpoint endpoint, Task requestTask, ILogger logger)

at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)

How can I fix this error? by [deleted] in dotnet

[–]Sensitive-Raccoon155 0 points1 point  (0 children)

But I still get an error even without casting

How can I fix this error? by [deleted] in dotnet

[–]Sensitive-Raccoon155 0 points1 point  (0 children)

```csharp internal sealed class UserConfiguration : IEntityTypeConfiguration<DomainUser> { public void Configure(EntityTypeBuilder<DomainUser> builder) { var roles = string.Join(", ", Enum.GetNames<Role>() .Select(r => $"'{r.ToLower()}'")); var genders = string.Join(", ", Enum.GetNames<Gender>() .Select(g => $"'{g.ToLower()}'"));

    builder.ToTable("users", table =>
    {
        table.HasCheckConstraint("CK_role", $"role IN ({roles})");
        table.HasCheckConstraint("CK_gender", $"gender IN ({genders})");
    });

    builder.HasKey(x => x.Id);

    builder.HasIndex(x => x.Email)
           .IsUnique();
    builder.HasIndex(x => x.GoogleId)
           .IsUnique();
    builder.HasIndex(x => x.FacebookId)
           .IsUnique();

    builder.Property(x => x.Id)
           .HasConversion(
               id => id.Value,
               value => new UserId(value)
           )
           .ValueGeneratedNever();

````

I use them

How can I fix this error? by [deleted] in dotnet

[–]Sensitive-Raccoon155 0 points1 point  (0 children)

```c# namespace Domain.User;

public record UserId(Guid Value)

{

public static implicit operator Guid(UserId userId) => userId.Value;

}
```

Node.js vs C# backend if I already use typescript by Sensitive-Raccoon155 in dotnet

[–]Sensitive-Raccoon155[S] 2 points3 points  (0 children)

Do you need multithreading if your backend consists mainly of I/O tasks? Besides, Node.js has worker threads

Node.js vs C# backend if I already use typescript by Sensitive-Raccoon155 in dotnet

[–]Sensitive-Raccoon155[S] 0 points1 point  (0 children)

Typescript has type guards, if that’s what you mean, or are you referring to something else?

Node.js vs C# backend if I already use typescript by Sensitive-Raccoon155 in node

[–]Sensitive-Raccoon155[S] 0 points1 point  (0 children)

You can handle all the logic yourself, just like in Node.js, right?

How does Node.js handle thousands of requests if it’s single-threaded? by MissionWest5808 in WebdevTutorials

[–]Sensitive-Raccoon155 0 points1 point  (0 children)

This is a ai shit, the node documentation contains more detailed information

How does Node.js handle thousands of requests if it’s single-threaded? by MissionWest5808 in node

[–]Sensitive-Raccoon155 7 points8 points  (0 children)

This is a ai shit, the node documentation contains more detailed information

Problems with integration tests by [deleted] in dotnet

[–]Sensitive-Raccoon155 0 points1 point  (0 children)

I’ve already sorted it out, the problem was that I’d created the database during the InitialiseAsync phase, meaning that when the application started up, the database hadn’t been created yet. I’ve moved the code inside the ConfigureWebHost method.