FraznoFire
FraznoFire
Explore posts from servers
CC#
Created by FraznoFire on 11/12/2024 in #help
Naming factories “class”factory always a good idea?
It is purely to create objects that implement that interface, but I thought it might give more of a clue as to its purpose by saying it’s specifically to resolve/identify the specific implementation required for a given device, not a general purpose way to implement IVendorThing
10 replies
CC#
Created by FraznoFire on 9/22/2024 in #help
Return Value on Entity Modification
Come to think of it, would it be better to write the property modification code into the “get/set” methods of the property? Or at least in the class itself? That way nothing in the code base can incorrectly modify the values outside of business logic?
7 replies
CC#
Created by FraznoFire on 9/22/2024 in #help
Return Value on Entity Modification
oh ok, I thought that if my code was unnecssarily returning object references it might cause a memory leak or performance issue
7 replies
CC#
Created by FraznoFire on 9/1/2024 in #help
Non-Nullable type "required" double up.
Actually, why does it complain about having ‘string’ without a ‘required’, but doesn’t care about other types like GUID?
24 replies
CC#
Created by FraznoFire on 9/1/2024 in #help
Non-Nullable type "required" double up.
That looks to be a bit out of my depth for the moment, but I will keep it as a reference for the future, thanks for your help!
24 replies
CC#
Created by FraznoFire on 9/1/2024 in #help
Non-Nullable type "required" double up.
I can't find anything that says you can do it outside of the dbcontext
24 replies
CC#
Created by FraznoFire on 9/1/2024 in #help
Non-Nullable type "required" double up.
ah ok, I might stick with the Data Annotations for the time being because at least for me it's a bit easier to keep track of, since it's in the same place as the model itself
24 replies
CC#
Created by FraznoFire on 9/1/2024 in #help
Non-Nullable type "required" double up.
When the docs mention using FluentAPI by creating an override method to override the model builder, where do I put that? inside the model itself?
24 replies
CC#
Created by FraznoFire on 9/1/2024 in #help
Non-Nullable type "required" double up.
So if I wanted to use attributes like [Key] and [DatabaseGeneratedOption...], there are FluentAPI options available for that as well?
24 replies
CC#
Created by FraznoFire on 9/1/2024 in #help
Non-Nullable type "required" double up.
Will do, thank you!
24 replies
CC#
Created by FraznoFire on 9/1/2024 in #help
Non-Nullable type "required" double up.
Oh so anything that doesn't have <T>? is practically the same as [Required] as far as EF is concerned?
24 replies
CC#
Created by FraznoFire on 6/8/2024 in #help
Best practice for Database EF Migrations (Auto v Manual)
Now I’m wondering if I should just have an init container that has an sql client and runs the .sql script, rather than output the sql script and the compiled bundle
27 replies
CC#
Created by FraznoFire on 6/8/2024 in #help
Best practice for Database EF Migrations (Auto v Manual)
Aaah ok
27 replies
CC#
Created by FraznoFire on 6/8/2024 in #help
Best practice for Database EF Migrations (Auto v Manual)
And those scripts are the exact steps the bundle executable would use?
27 replies
CC#
Created by FraznoFire on 6/8/2024 in #help
Best practice for Database EF Migrations (Auto v Manual)
aah but now I'm worried about using bundles, the Microsoft documentation mentions that the sql script means you can visually inspect what it will do so there's (hopefully) no unexpected surprises. Not sure if it is possible to get that level of transparency from the bundle
27 replies
CC#
Created by FraznoFire on 6/8/2024 in #help
Best practice for Database EF Migrations (Auto v Manual)
In Aus, medical apps in particular are very behind the times. Of the ~4/5 prevalent ones we deal with they were pretty much all written 20 years ago with no real changes since. They work "fine" from a user standpoint, but when we have to update them.. it's a 2-3 hour manual process.
27 replies
CC#
Created by FraznoFire on 6/8/2024 in #help
Best practice for Database EF Migrations (Auto v Manual)
Man I wish the apps I dealt with at work were built like that
27 replies
CC#
Created by FraznoFire on 6/8/2024 in #help
Best practice for Database EF Migrations (Auto v Manual)
Oh interesting, so does that wait for current DB transactions to finish up? or would it fail if anything else is talking to the DB at that time?
27 replies
CC#
Created by FraznoFire on 6/8/2024 in #help
Best practice for Database EF Migrations (Auto v Manual)
oh interesting
27 replies
CC#
Created by FraznoFire on 6/8/2024 in #help
Best practice for Database EF Migrations (Auto v Manual)
Ok, I've decided I will go ahead with using bundles to export the actual migration to a binary, and to apply it in production in my docker compose, I will have it setup as a service and tell my api to wait for service completed successfully using depends on in docker compose. Was looking for something similar in Kubernetes, ie can I make a container that starts and finished before my actual app, and turns out, I can. They're called init containers. So in short I will have my CI/CD push out a migration bundle whenever new migrations are made (should be quite rare), and have my docker/kubernetes run a single instance of this before starting any instances of my API. Thanks guys, I guess I just needed to post here as like a rubber ducky type thing.
27 replies