Any questions or suggestions? Do add a comment. Source code is at github.com/JasperKent/Entity-Framework-Fluent-API Subscribe for more at: kzbin.info/door/qWQzlUDdllnLmtgfSgYTCA And if you liked it, give it a 👍!
@niroshanmanoharan42953 жыл бұрын
Thank you for the reply "Auditable BaseEntity" this is my base entity when I inherited this to customer class it's automatically creating a table when doing the migration. How to ignore creating the table.
@CodingTutorialsAreGo3 жыл бұрын
@@niroshanmanoharan4295 There are two ways to do inheritance in EF Core, known as Table Per Hierarchy and Table Per Type. (EF6 also has Table Per Concrete Type). Try this video for details and let me know if it helps: kzbin.info/www/bejne/Zp_HpmqQnchrarM
@robdevoer1 Жыл бұрын
I am so glad that I ran into your marvellous series today. After years of working with C# and EF you managed to fill in a few holes in my knowledge and made me understand some of my bad habits. Your clear and detailed approach in every session of this tutorial series is enjoyable and kept me engaged. A big thanks!!
@nitish_5262 Жыл бұрын
thankyou thankyou thankyou. commenting in 12.43 am thanks a lot for this explanation
@oncalldev2 жыл бұрын
Very clear explanation. Just popped in on Part 9. I'm sure I'll be circling back to view the prior tutorials as well the seeing the subsequent ones. Thanks.
@ajonescouk3 жыл бұрын
Thanks again. I'm working my way through your videos so you may cover this later *but* it strikes me that classes designed specifically as code-first tables (the first M in MVVM) are nicely configured with attributes. Classes in my libraries (I do optics so have utility classes representing a prism, for example) can be more nicely configured using Fluent API - that way my library never has to "know" that the classes will be stored in a database but my Model library can still configure as needed. Your videos are really helping me to clean my data access code so the whole lot is going to be more logical to read back in 5 years time, thank you!
@CodingTutorialsAreGo3 жыл бұрын
Yes, you're right - using the fluent API makes your entity classes ignorant of the the DB. That said, the Model in MVV-M shouldn't really be stored directly in the database. See kzbin.info/www/bejne/bGKXZoRnn9qJfqs, which covers MVC, but the M is the same.
@danielvelkov1163 жыл бұрын
ty colonel sanders for this tutorial
@hanspetervollhorst12 жыл бұрын
Don't understand why this channel has so few subscribers.
@sagivalia5041 Жыл бұрын
Hey there, when I override the OnModelCreating method, do I need to do all the work EF does along with the special configs that I wanna do? or can I call base.OnModelCreating and then do the special configs that I want?
@CodingTutorialsAreGo Жыл бұрын
You should call base.OnModelCreating and then just do what is different from the conventional mapping.
@acattani2 жыл бұрын
Excellent lesson. Thank you.
@AshleyMathClass2 жыл бұрын
do any of your EF videos show adding unique constraints on multiple columns?
@CodingTutorialsAreGo2 жыл бұрын
I don't think I have, but the answer here seems to do it: stackoverflow.com/a/4950635/2667528
@coldhands92 Жыл бұрын
how does without adding migrations and updating db your sql server db is getting updated just by running the project ??
@CodingTutorialsAreGo Жыл бұрын
That's because I use 'EnsureCreated'. It looks to see if the DB exists, and if not, creates it. I wouldn't use it in a real application because, as you say, we lose the migration history. But it's handy for demos.
@coldhands92 Жыл бұрын
@@CodingTutorialsAreGo oh so are u deleting the db and re creating it everytime ?even with that for demo it's actually smart I just wanted to learn about fluent api so I didn't know how u set it up. Thanks for responding.
@zergzerg4844 Жыл бұрын
Do I need after the whole configuring delete the OnModulcreating method?
@CodingTutorialsAreGo Жыл бұрын
Sorry, I don't understand.
@emreaka39653 жыл бұрын
Thanks!
@niroshanmanoharan42953 жыл бұрын
Thank you for the video. When we using Fluent Api as a separate base class it automatically creating a table. How to avoid this? Could you please explain? public void Configure(EntityTypeBuilder builder) { builder .Property(v => v.CreatedBy) .HasMaxLength(20); builder .Property(v => v.LastModifiedBy) .HasMaxLength(20); }
@CodingTutorialsAreGo3 жыл бұрын
Hi Niroshan, Thanks for the question, but I'm not really getting what the problem is. Can you add a little more information? Cheers.
@hanspetervollhorst12 жыл бұрын
EFCoreWeb is not in the repository
@CodingTutorialsAreGo2 жыл бұрын
Sorry about that. I'll see if I can resurrect it.
@CodingTutorialsAreGo2 жыл бұрын
Actually, that project is never used in what we're discussing here - I guess that's why I deleted it before I pushed.