IcyIme
IcyIme
CC#
Created by IcyIme on 6/26/2024 in #help
i want to migrate db from sqlserver to supabase(postressql) but i have error with entitity framework
i want to migrate db from sqlserver to supabase(postressql) but i have error with entitity framework
SELECT EXISTS (
SELECT 1 FROM pg_catalog.pg_class c
JOIN pg_catalog.pg_namespace n ON n.oid=c.relnamespace
WHERE n.nspname='public' AND
c.relname='__EFMigrationsHistory'
)
Npgsql.NpgsqlException (0x80004005): Exception while reading from stream
---> System.TimeoutException: Timeout during reading attempt
at Npgsql.Internal.NpgsqlReadBuffer.<Ensure>g__EnsureLong|55_0(NpgsqlReadBuffer buffer, Int32 count, Boolean async, Boolean readingNotifications)
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
at Npgsql.Internal.NpgsqlConnector.ReadMessageLong(Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage)
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
at Npgsql.NpgsqlDataReader.NextResult()

Exception while reading from stream
SELECT EXISTS (
SELECT 1 FROM pg_catalog.pg_class c
JOIN pg_catalog.pg_namespace n ON n.oid=c.relnamespace
WHERE n.nspname='public' AND
c.relname='__EFMigrationsHistory'
)
Npgsql.NpgsqlException (0x80004005): Exception while reading from stream
---> System.TimeoutException: Timeout during reading attempt
at Npgsql.Internal.NpgsqlReadBuffer.<Ensure>g__EnsureLong|55_0(NpgsqlReadBuffer buffer, Int32 count, Boolean async, Boolean readingNotifications)
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
at Npgsql.Internal.NpgsqlConnector.ReadMessageLong(Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage)
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
at Npgsql.NpgsqlDataReader.NextResult()

Exception while reading from stream
3 replies
CC#
Created by IcyIme on 6/23/2024 in #help
i migrating from sqlserver to mongo db but in login the page throeing an errror ExpressionNotSupport
No description
16 replies
CC#
Created by IcyIme on 3/23/2024 in #help
I want to make a dynamic compiler of c# code and with that have a console on the web page, using thi
I want to make a dynamic compiler of c# code and with that have a console on the web page, using this it will be possible to interact with the code
14 replies
CC#
Created by IcyIme on 1/25/2024 in #help
i have problem with ef core in rider
/usr/lib/dotnet/dotnet ef database update --project TeamManager/TeamManager.csproj --startup-project TeamManager/TeamManager.csproj --context TeamManager.Data.ApplicationDbContext --configuration Debug 20240124212353_azure
Could not execute because the specified command or file was not found.
Possible reasons for this include:
* You misspelled a built-in dotnet command.
* You intended to execute a .NET program, but dotnet-ef does not exist.
* You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
/usr/lib/dotnet/dotnet ef database update --project TeamManager/TeamManager.csproj --startup-project TeamManager/TeamManager.csproj --context TeamManager.Data.ApplicationDbContext --configuration Debug 20240124212353_azure
Could not execute because the specified command or file was not found.
Possible reasons for this include:
* You misspelled a built-in dotnet command.
* You intended to execute a .NET program, but dotnet-ef does not exist.
* You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
4 replies
CC#
Created by IcyIme on 1/10/2024 in #help
blazor implementing 404 page
blazor web app .net 8 not triggering <NotFound> tag how to fix it ?
@using BlazorApp33.Components.Account.Shared
<Router AppAssembly="@typeof(Program).Assembly">
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)">
<NotAuthorized>
<RedirectToLogin />
</NotAuthorized>
</AuthorizeRouteView>
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
<NotFound>
<h1>404 Not Found</h1>
</NotFound>
</Router>
@using BlazorApp33.Components.Account.Shared
<Router AppAssembly="@typeof(Program).Assembly">
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)">
<NotAuthorized>
<RedirectToLogin />
</NotAuthorized>
</AuthorizeRouteView>
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
<NotFound>
<h1>404 Not Found</h1>
</NotFound>
</Router>
3 replies
CC#
Created by IcyIme on 1/4/2024 in #help
Blazor roles
how to make role based auth in blazor server I've been trying to do it for 2 days and I didn't get anywhere, tutorials didn't help either chatgpt
2 replies
CC#
Created by IcyIme on 1/1/2024 in #help
problem with entityframework migration
error: An error occurred while accessing the Microsoft.Extensions.Hosting services. Continuing without the application service provider. Error: Failed to load configuration from file 'C:\Users\peter\source\repos\BlazingBlog\BlazingBlog\appsettings.json'. Unable to create a 'DbContext' of type ''. The exception 'Unable to resolve service for type 'Microsoft.EntityFrameworkCore.DbContextOptions`1[BlazingBlog.Data.BlogContext]' while attempting to activate 'BlazingBlog.Data.BlogContext'.' was thrown while attempting to create an instance. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728 code:
using BlazingBlog.Data.Entities;
using Microsoft.EntityFrameworkCore;

namespace BlazingBlog.Data
{
public class BlogContext : DbContext
{
public BlogContext(DbContextOptions<BlogContext> options) : base(options)
{

}

public DbSet<Category> Categories { get; set; }
public DbSet<User> Users { get; set; }
public DbSet<BlogPost> BlogPosts { get; set; }

protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
base.OnConfiguring(optionsBuilder);
#if DEBUG
optionsBuilder.LogTo(Console.WriteLine);
#endif
}

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);

modelBuilder.Entity<User>()
.HasData(
new User
{
Id = 1,
Email = "peter.odrok@outlook.sk",
FirstName = "Peter",
LastName = "Odak",
Salt = "dasdasdasd",
Hash = "dsalkdjasklfjdsalkjfdsakljfalskjdas"
}
);
}
}
}
using BlazingBlog.Data.Entities;
using Microsoft.EntityFrameworkCore;

namespace BlazingBlog.Data
{
public class BlogContext : DbContext
{
public BlogContext(DbContextOptions<BlogContext> options) : base(options)
{

}

public DbSet<Category> Categories { get; set; }
public DbSet<User> Users { get; set; }
public DbSet<BlogPost> BlogPosts { get; set; }

protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
base.OnConfiguring(optionsBuilder);
#if DEBUG
optionsBuilder.LogTo(Console.WriteLine);
#endif
}

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);

modelBuilder.Entity<User>()
.HasData(
new User
{
Id = 1,
Email = "peter.odrok@outlook.sk",
FirstName = "Peter",
LastName = "Odak",
Salt = "dasdasdasd",
Hash = "dsalkdjasklfjdsalkjfdsakljfalskjdas"
}
);
}
}
}
4 replies
CC#
Created by IcyIme on 10/22/2023 in #help
❔ what learn first as beginerr blazor or asp.net
i want to go web dev route with c# and i am confused what is better learn first asp.net or blazor
17 replies
CC#
Created by IcyIme on 8/10/2023 in #help
❔ asp.net core with angular or blazor which pick?
i wonder what is better to start new projects... asp.net with angular or asp.net with blazor
33 replies
CC#
Created by IcyIme on 8/9/2023 in #help
next learn step is kinda confusing
I'm choosing between two frameworks, asp.net or .net maui, and I don't know what's better than learning... I thought about asp.net, but the learn path is quite confusing...
33 replies
CC#
Created by IcyIme on 7/17/2023 in #help
❔ problem with understanding delegates and generics
I have a problem with understanding delegates and generics and I'm already spending a lot of time on it and I don't understand where and in what situations to use it and why it's used and what it's good for... I went through several sources and none of them helped, thanks in advance for your help and i forgot interfaces
65 replies
CC#
Created by IcyIme on 3/16/2023 in #help
❔ BEST LEARNING PATH FOR ASP.NET
I am confused about asp.net and i do not know where to start with it.
8 replies