Avalari
Avalari
CC#
Created by TrattTratt on 5/6/2024 in #help
Where to store passwords and ApiKeys for production ASP.NET
don't bundle them into the project
24 replies
CC#
Created by TrattTratt on 5/6/2024 in #help
Where to store passwords and ApiKeys for production ASP.NET
for pictures you should use a storage container
24 replies
CC#
Created by TrattTratt on 5/6/2024 in #help
Where to store passwords and ApiKeys for production ASP.NET
depending on the project complexity Azure services can be cheap
24 replies
CC#
Created by TrattTratt on 5/6/2024 in #help
Where to store passwords and ApiKeys for production ASP.NET
take a look at the concept of "managed entities"
24 replies
CC#
Created by TrattTratt on 5/6/2024 in #help
Where to store passwords and ApiKeys for production ASP.NET
also, nowadays storing a static user/password in DB connection string is not a good practice
24 replies
CC#
Created by TrattTratt on 5/6/2024 in #help
Where to store passwords and ApiKeys for production ASP.NET
then use your hosting equivalent
24 replies
CC#
Created by TrattTratt on 5/6/2024 in #help
Where to store passwords and ApiKeys for production ASP.NET
:pikawhat:
24 replies
CC#
Created by TrattTratt on 5/6/2024 in #help
Where to store passwords and ApiKeys for production ASP.NET
are you using a LocalDB instance in prod?
24 replies
CC#
Created by TrattTratt on 5/6/2024 in #help
Where to store passwords and ApiKeys for production ASP.NET
24 replies
CC#
Created by pkp24 on 7/31/2023 in #help
missing object editing window
View -> Properties Window
4 replies
CC#
Created by Avalari on 7/21/2023 in #help
✅ [DDD] Reference IdentityUser in Domain model class
I was able to make it work by casting the interface:
entity.HasOne(typeof(ApplicationUser), "User")
.WithMany()
.HasForeignKey("UserId")
.IsRequired();
entity.HasOne(typeof(ApplicationUser), "User")
.WithMany()
.HasForeignKey("UserId")
.IsRequired();
6 replies
CC#
Created by Avalari on 7/21/2023 in #help
✅ [DDD] Reference IdentityUser in Domain model class
I tried making a User surrogate class but on DB creation a separate "User" table is created instead of using the default IdentityUser table. I also tried using a IUser interface in the Domain:
public virtual IUser User { get; set; }
public virtual IUser User { get; set; }
and then in the Persistance:
ApplicationUser : IdentityUser<string>, IUser
ApplicationUser : IdentityUser<string>, IUser
but EF does not let this go because:
The specified type 'AppName.Domain.Contracts.IUser' must be a non-interface reference type to be used as an entity type.
The specified type 'AppName.Domain.Contracts.IUser' must be a non-interface reference type to be used as an entity type.
am I missing something here?
6 replies
CC#
Created by Avalari on 11/4/2022 in #help
[Entity Framework] Issues with .Include()
tho should I get rid of Virtual tags in case of Selecting what I want?
28 replies
CC#
Created by Avalari on 11/4/2022 in #help
[Entity Framework] Issues with .Include()
@Angius thanks for helping out (y)
28 replies
CC#
Created by Avalari on 11/4/2022 in #help
[Entity Framework] Issues with .Include()
also tried:
var item = await _context.Items
.Where(s => s.Id == id)
.FirstOrDefaultAsync<Item>();

_context.Entry(item).Collection(s => s.Sets)
.Query()
.Include(b => b.Set)
.Load();
var item = await _context.Items
.Where(s => s.Id == id)
.FirstOrDefaultAsync<Item>();

_context.Entry(item).Collection(s => s.Sets)
.Query()
.Include(b => b.Set)
.Load();
28 replies
CC#
Created by Avalari on 11/4/2022 in #help
[Entity Framework] Issues with .Include()
I get the intended return without obsolete data
28 replies
CC#
Created by Avalari on 11/4/2022 in #help
[Entity Framework] Issues with .Include()
I went with @Angius's rout and just formed a nested Select
28 replies
CC#
Created by Avalari on 11/4/2022 in #help
[Entity Framework] Issues with .Include()
forgot to mentioned that I've tried it since the beginning and even with:
builder.Services.AddControllersWithViews()
.AddJsonOptions(x => x.JsonSerializerOptions.ReferenceHandler = ReferenceHandler.IgnoreCycles);
builder.Services.AddControllersWithViews()
.AddJsonOptions(x => x.JsonSerializerOptions.ReferenceHandler = ReferenceHandler.IgnoreCycles);
it thrown me into a loop of Item -> Sets -> Item -> Sets=null
28 replies
CC#
Created by Avalari on 11/4/2022 in #help
[Entity Framework] Issues with .Include()
anything bad with using virtual? 😄
28 replies