Alex
Alex
CC#
Created by Alex on 7/2/2024 in #help
Recommend book/source
thank you for the answers
8 replies
CC#
Created by Alex on 6/28/2024 in #help
✅ Refresh Token + JWT + Identity
That's great that it providers solution out of the box, but I want to write my own endpoint to understand how it works and how it can be implemented with Identity
6 replies
CC#
Created by Alex on 6/28/2024 in #help
✅ Refresh Token + JWT + Identity
.
6 replies
CC#
Created by Alex on 6/25/2024 in #help
✅ How to get Options from DI
Thank you for the answers
14 replies
CC#
Created by Alex on 6/25/2024 in #help
✅ How to get Options from DI
My question is how can I get options that I configured above exactly in .AddGoogle()?
14 replies
CC#
Created by Alex on 6/17/2024 in #help
What's wrong with my LINQ expression?
No description
56 replies
CC#
Created by Alex on 6/17/2024 in #help
What's wrong with my LINQ expression?
thank you!
56 replies
CC#
Created by Alex on 6/17/2024 in #help
What's wrong with my LINQ expression?
that's was the problem, I changed .Where(u => u.LockoutEnd != null && u.LockoutEnd > DateTimeOffset.UtcNow) to var utcNow = DateTimeOffset.UtcNow and .Where(u => u.LockoutEnd != null && u.LockoutEnd > utcNow) and it works fine
56 replies
CC#
Created by Alex on 6/17/2024 in #help
What's wrong with my LINQ expression?
yes
56 replies
CC#
Created by Alex on 6/17/2024 in #help
What's wrong with my LINQ expression?
InvalidOperationException: The LINQ expression 'DbSet<IdentityUser>()
.Where(i => i.LockoutEnd != null && i.LockoutEnd > (DateTimeOffset?)DateTimeOffset.UtcNow)' 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'.
InvalidOperationException: The LINQ expression 'DbSet<IdentityUser>()
.Where(i => i.LockoutEnd != null && i.LockoutEnd > (DateTimeOffset?)DateTimeOffset.UtcNow)' 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'.
56 replies
CC#
Created by Alex on 6/17/2024 in #help
What's wrong with my LINQ expression?
should I add it instead of previous code?
56 replies
CC#
Created by Alex on 6/17/2024 in #help
What's wrong with my LINQ expression?
No description
56 replies
CC#
Created by Alex on 6/17/2024 in #help
What's wrong with my LINQ expression?
yes, I added code:
if (Database.IsSqlite())
{
// SQLite does not have proper support for DateTimeOffset via Entity Framework Core, see the limitations
// here: https://docs.microsoft.com/en-us/ef/core/providers/sqlite/limitations#query-limitations
// To work around this, when the Sqlite database provider is used, all model properties of type DateTimeOffset
// use the DateTimeOffsetToBinaryConverter
// Based on: https://github.com/aspnet/EntityFrameworkCore/issues/10784#issuecomment-415769754
// This only supports millisecond precision, but should be sufficient for most use cases.
foreach (var entityType in builder.Model.GetEntityTypes())
{
var properties = entityType.ClrType.GetProperties().Where(p => p.PropertyType == typeof(DateTimeOffset)
|| p.PropertyType == typeof(DateTimeOffset?));
foreach (var property in properties)
{
builder
.Entity(entityType.Name)
.Property(property.Name)
.HasConversion(new DateTimeOffsetToBinaryConverter());
}
}
}
if (Database.IsSqlite())
{
// SQLite does not have proper support for DateTimeOffset via Entity Framework Core, see the limitations
// here: https://docs.microsoft.com/en-us/ef/core/providers/sqlite/limitations#query-limitations
// To work around this, when the Sqlite database provider is used, all model properties of type DateTimeOffset
// use the DateTimeOffsetToBinaryConverter
// Based on: https://github.com/aspnet/EntityFrameworkCore/issues/10784#issuecomment-415769754
// This only supports millisecond precision, but should be sufficient for most use cases.
foreach (var entityType in builder.Model.GetEntityTypes())
{
var properties = entityType.ClrType.GetProperties().Where(p => p.PropertyType == typeof(DateTimeOffset)
|| p.PropertyType == typeof(DateTimeOffset?));
foreach (var property in properties)
{
builder
.Entity(entityType.Name)
.Property(property.Name)
.HasConversion(new DateTimeOffsetToBinaryConverter());
}
}
}
to the protected override void OnModelCreating(ModelBuilder builder) and created a migration and updated database
56 replies
CC#
Created by Alex on 6/17/2024 in #help
What's wrong with my LINQ expression?
I tried to fix it with DateTimeOffsetToBinaryConverter (onModelCreating) but it doesn't work. I can switch to postgresql, there's no problem
56 replies
CC#
Created by Alex on 5/3/2024 in #help
✅ Google External sign in using Identity
No i haven't I switched to email password authentication for this project. I can recommend look through Pro ASP.NET Core Identity book which describes this topic closely
4 replies
CC#
Created by Alex on 5/16/2024 in #help
✅ SignalR client to client communication (chat)
okay, thank you
4 replies
CC#
Created by Alex on 5/15/2024 in #help
✅ what's the difference?
thank you, I understand
4 replies
CC#
Created by Alex on 5/11/2024 in #help
How can I accept multiple clients?
but also add template engine
26 replies
CC#
Created by Alex on 5/11/2024 in #help
How can I accept multiple clients?
Yes, I will, I already have a lot of things to think about besides parsing, I want to make something similar to asp.net minimal api
26 replies
CC#
Created by Alex on 5/11/2024 in #help
How can I accept multiple clients?
okay, thank you
26 replies