ben SKVU4-9YBC
ben SKVU4-9YBC
CC#
Created by Core on 4/4/2024 in #help
.NET EF - How to generate a new database in runtime (dynamically)?
Yep, I didn't really extend my answer to migrations, so thanks!
23 replies
CC#
Created by Core on 4/4/2024 in #help
.NET EF - How to generate a new database in runtime (dynamically)?
Huh? I think you can?
23 replies
CC#
Created by Core on 4/4/2024 in #help
.NET EF - How to generate a new database in runtime (dynamically)?
That would run all migrations, including the initial one, database would already exist?
23 replies
CC#
Created by Core on 4/4/2024 in #help
.NET EF - How to generate a new database in runtime (dynamically)?
You're assuming this is code first migrations?
23 replies
CC#
Created by Core on 4/4/2024 in #help
.NET EF - How to generate a new database in runtime (dynamically)?
No description
23 replies
CC#
Created by Core on 4/4/2024 in #help
.NET EF - How to generate a new database in runtime (dynamically)?
No problem!
23 replies
CC#
Created by Core on 4/4/2024 in #help
.NET EF - How to generate a new database in runtime (dynamically)?
In EF, databases are by default created at runtime anyway, when you start up the application, if they don't already exist. You can just go about it in the same manner, passing your dynamic database name into DbContextOptions and ensure it's being created with ctx.Database.EnsureCreatedAsync()
23 replies
CC#
Created by Slazmaz on 4/3/2024 in #help
Passing parameters to overloaded constructor
no problem
7 replies
CC#
Created by Slazmaz on 4/3/2024 in #help
Passing parameters to overloaded constructor
sure it would. public Sprite(string texture, ...) : this(Assets.Textures[texture], ...) {}
7 replies
CC#
Created by Slazmaz on 4/3/2024 in #help
Passing parameters to overloaded constructor
public Sprite(...) : this(...)
7 replies
CC#
Created by DannyRoastBeef㊙ on 4/3/2024 in #help
Using ref for large data types.
No worries, good luck 🙂
10 replies
CC#
Created by DannyRoastBeef㊙ on 4/3/2024 in #help
Using ref for large data types.
Short answer: use-case for ref is actually quite limited
10 replies
CC#
Created by DannyRoastBeef㊙ on 4/3/2024 in #help
Using ref for large data types.
I would not. Confirm that by making a change to one of the files in the list inside CheckValidFileTypes and step outside back into the SaveDataToStorage method, and the change is still reflected. You'll know then that no copies are made and it just passes around references
10 replies
CC#
Created by DannyRoastBeef㊙ on 4/3/2024 in #help
Using ref for large data types.
ASFAIK a list just contains a copy of the reference not the actual object. Meaning if you change something something on an object inside SaveDataToStorage you'll see the same changes when you step outside in files. You can confirm this quite easily
10 replies
CC#
Created by DannyRoastBeef㊙ on 4/3/2024 in #help
Using ref for large data types.
There may be some intricacies which I've forgotten around the reference pointer on reference types using the ref keyword but the object is still the same object
10 replies
CC#
Created by DannyRoastBeef㊙ on 4/3/2024 in #help
Using ref for large data types.
If you pass in your File class, whatever it's called or contains, you pass the reference to it not a copy. So no need to use ref here.
10 replies
CC#
Created by Bailey on 4/2/2024 in #help
✅ Theoretical question. MediatR and DTO and onion structure
bang on! if you're aware of architecture, you'll notice and adapt it over time
16 replies
CC#
Created by Bailey on 4/2/2024 in #help
✅ Theoretical question. MediatR and DTO and onion structure
yeah sounds like a good start, as it grows, you can create more layers
16 replies
CC#
Created by Bailey on 4/2/2024 in #help
✅ Theoretical question. MediatR and DTO and onion structure
I'll have support for EF core writing and dapper reads in a separate layer, a layer for services, then the CQRS layer which may or may not even use the services, then the API
16 replies
CC#
Created by Bailey on 4/2/2024 in #help
✅ Theoretical question. MediatR and DTO and onion structure
That's what I've been doing for a while. AutoMapper is reflection convention based which is really popular. I just don't like the black box nature of it. I feel more comfortable seeing all my mappings explicitly. Not so familiar with all these new terminologies, I'm guessing it's a bit like clean architecture which I've seen and used to some degree myself. I never really force an architectural pattern to projects, it tends to just come out naturally. My domain is always at the very bottom with no dependencies above. I don't really do all the database adapter stuff bob martin harps on about
16 replies