Faker
Faker
Explore posts from servers
CC#
Created by Faker on 2/23/2025 in #help
What is Repository pattern design and how to implement it
yep I see, creating another repository would be like the picture, trying to drive a car over a car ?
19 replies
CC#
Created by Faker on 2/23/2025 in #help
What is Repository pattern design and how to implement it
so, I don't have to use a repository thing with EF core, I can just skip it ?
19 replies
CC#
Created by Faker on 2/23/2025 in #help
What is Repository pattern design and how to implement it
yeah I see
19 replies
CC#
Created by Faker on 2/23/2025 in #help
What is Repository pattern design and how to implement it
hmm what is an anti-pattern please; it's just something that add more complexity to our code?
19 replies
CC#
Created by Faker on 2/22/2025 in #help
? operator and property assigned to =null! meaning in EF core database context
yep I see, thanks !
44 replies
CC#
Created by Faker on 2/22/2025 in #help
? operator and property assigned to =null! meaning in EF core database context
yeah I see, in the DTO thing, we would have 2 queries then, like we wouldn't be able to use a single query to fetch both a subset of Book data and use that in our next query?
44 replies
CC#
Created by Faker on 2/22/2025 in #help
? operator and property assigned to =null! meaning in EF core database context
Ok guys, just need to do small summary, please confirm whether the following is correct/add up to it if needed pls: 1. ? is used to explicitly say that we are expecting a particular column to be null in the database context. For example, int PublishedYear means this is a nullable field. 2. If we have reference types, like string, the default value of string and any other referenced type is null. But without the ?, we need to provide a value. We provide a value, like null then we just suppress the warning using the null-forigiving operator !. (Would have been better to use a default value here @ZZZZZZZZZZZZZZZZZZZZZZZZZ ? why pls like you said either use default value or required attribute; what does the required attribute do in this case?) 3. Also, just read about the Include() thing. Basically, the nav property which linked a particular object to another entity, that object can be null if it's not loaded; that's where it might be useful to use the ? operator. Now, in order for the object, not to be null, we use the Include() method which loads them "eagerly" something like that.
44 replies
CC#
Created by Faker on 2/22/2025 in #help
? operator and property assigned to =null! meaning in EF core database context
yep I see
44 replies
CC#
Created by Faker on 2/22/2025 in #help
? operator and property assigned to =null! meaning in EF core database context
if we don't pass a value for it in the constructor, we would get an exception?
44 replies
CC#
Created by Faker on 2/22/2025 in #help
? operator and property assigned to =null! meaning in EF core database context
yep I see
44 replies
CC#
Created by Faker on 2/22/2025 in #help
? operator and property assigned to =null! meaning in EF core database context
So the thing is, anything declared as non-nullable (we don't have the ? operator should be assigned to something at compile-time to remove the warning ?)
44 replies
CC#
Created by Faker on 2/22/2025 in #help
? operator and property assigned to =null! meaning in EF core database context
No description
44 replies
CC#
Created by Faker on 2/22/2025 in #help
? operator and property assigned to =null! meaning in EF core database context
hmm so this give us another question :c : When to use the null! thing? Like if I've understood correctly, we are saying ok, this thing cannot be null but we are still assigning null to it but ignore the warning, we will pass a value to it later on.
44 replies
CC#
Created by Faker on 2/22/2025 in #help
? operator and property assigned to =null! meaning in EF core database context
yeah I see, but when we say a warning, is it something that we won't be able to run the code with? it's mandatory here?
44 replies
CC#
Created by Faker on 2/22/2025 in #help
? operator and property assigned to =null! meaning in EF core database context
ohhhh, ok, hmm what about the null! pls
44 replies
CC#
Created by Faker on 2/22/2025 in #help
? operator and property assigned to =null! meaning in EF core database context
oh ok, without the ? operator, we would have the NOT NULL constraint on the column in the database?
44 replies
CC#
Created by Faker on 2/22/2025 in #help
Is it possible to change Migrations folder path when updating database using UI tools for EF Core
Yep it worked, thanks !
28 replies
CC#
Created by Faker on 2/22/2025 in #help
Is it possible to change Migrations folder path when updating database using UI tools for EF Core
Ok 👍
28 replies
CC#
Created by Faker on 2/22/2025 in #help
Is it possible to change Migrations folder path when updating database using UI tools for EF Core
Yeah, will try and come back and let you know
28 replies
CC#
Created by Faker on 2/22/2025 in #help
Is it possible to change Migrations folder path when updating database using UI tools for EF Core
I will try again later on to see if it works
28 replies