Dave Callan
Microsoft MVP | Senior Software Engineer | .NET Content Creator
- Report this post
Entity Framework FILTERED INCLUDE() example ⬇️Using Include() is super common to eager load our child navigation collections, it's default usage however could potentially result in a lot of unnecessary data coming back, particularly in systems which deal with large volumes of data. Thankfully Entity Framework allows us to filter (and sort) our Includes() as the simple example below shows ...Do you use filtered Includes() much?
336
20 Comments
Dave Callan
Microsoft MVP | Senior Software Engineer | .NET Content Creator
5d
- Report this comment
Reposts appreciated to help support my content 😊
1Reaction
Sebastian Pinski
Software Development Manager - Financial Systems at Amazon Prime Video
5d
- Report this comment
Not sure what the “Where” is doing in this example.
2Reactions 3Reactions
Allen Huber
16-year .NET developer (Blazor, UWP, MAUI, Windows Forms) on the verge of giving up | **Improving at** Web API, MVC, and WinApp SDK/WinUI3 | devblog.allenhuber.com/blog
5d
- Report this comment
I don't use Entity Framework professionally but dabble on the side just to maintain a little hands-on. Based on my notes, I had never used this before, so I've learned something new! 👍
1Reaction 2Reactions
Kirill T.
Senior Software Engineer | .NET Core & Java Expert | Microservices & Scalable Systems | Driving Innovation in Tampa Bay’s Tech Industry
5d
- Report this comment
2Reactions 3Reactions
Manoj Jadhav
Senior Software Developer @ Weatherford | C# .Net Angular WCF WPF | SQL |EF| High Level and Low Level Design | System Design Principal | Database Design Principal | Agile Development | Micro-service architecture
5d
- Report this comment
Dave Callan thanks for the sharing.how was the permanence in numbers if you can include will be helpful?
1Reaction 2Reactions
Kais Alar
Software Engineer | Backend Developer | .NET Core | C#
20h
- Report this comment
Thanks a lot for sharing, but what about nested includes?
1Reaction
Poorna Soysa
Tech Enthusiast | .Net | C# | Azure | AWS
5d
- Report this comment
I use. Nice feature. Thanks for sharing Dave
1Reaction 2Reactions
Nuno Figueira
Senior Software Engineer | Linux | Firmware Developer | Team player
4d
- Report this comment
The first time I use include property was in EF7, just because this version apparently does not include by default some related entities... In my case on methods First, Find, Select...For exempla,BankAcount{Address,Contacts}Adress {}Contacts {}
1Reaction 2Reactions
Miguel Parra
Fullstack | .Net | SQL Server | Angular | HTML | CSS | Javascript | Microsserviços | RabbitMQ | Azure | DevOps | Redis | Ágil | SQL | API | REST | GIT | Entity Framework | C# | Docker | Espanhol | Inglês | Freelance
2d
- Report this comment
Thanks for sharing
1Reaction
Savino Carlone
Solution Architect presso FATTUTTO | Torino .NET Meetup DotNetFoundation Organizer | Public Speaker | Press Office @Henoel Grech
5d
- Report this comment
It is great. I use it.
1Reaction 2Reactions
To view or add a comment, sign in
More Relevant Posts
-
Dave Callan
Microsoft MVP | Senior Software Engineer | .NET Content Creator
- Report this post
𝗘𝘅𝗽𝗹𝗼𝗿𝗶𝗻𝗴 𝗖# 𝟭𝟮 𝗳𝗲𝗮𝘁𝘂𝗿𝗲𝘀 blog series 💡 Really enjoyed this four part series from David Pine on the main MS devblogs site which looks at how we might apply some of the new features of C# 12 such as primary constructors and collection expressions to our codebases. 𝗥𝗲𝗳𝗮𝗰𝘁𝗼𝗿 𝘆𝗼𝘂𝗿 𝗖# 𝗰𝗼𝗱𝗲 𝘄𝗶𝘁𝗵 𝗽𝗿𝗶𝗺𝗮𝗿𝘆 𝗰𝗼𝗻𝘀𝘁𝗿𝘂𝗰𝘁𝗼𝗿𝘀https://lnkd.in/eAqBaDeR𝗥𝗲𝗳𝗮𝗰𝘁𝗼𝗿 𝘆𝗼𝘂𝗿 𝗖# 𝗰𝗼𝗱𝗲 𝘄𝗶𝘁𝗵 𝗰𝗼𝗹𝗹𝗲𝗰𝘁𝗶𝗼𝗻 𝗲𝘅𝗽𝗿𝗲𝘀𝘀𝗶𝗼𝗻𝘀https://lnkd.in/eNGf82Ft𝗥𝗲𝗳𝗮𝗰𝘁𝗼𝗿 𝘆𝗼𝘂𝗿 𝗖# 𝗰𝗼𝗱𝗲 𝗯𝘆 𝗮𝗹𝗶𝗮𝘀𝗶𝗻𝗴 𝗮𝗻𝘆 𝘁𝘆𝗽𝗲https://lnkd.in/eat-ReJp𝗥𝗲𝗳𝗮𝗰𝘁𝗼𝗿 𝘆𝗼𝘂𝗿 𝗰𝗼𝗱𝗲 𝘄𝗶𝘁𝗵 𝗱𝗲𝗳𝗮𝘂𝗹𝘁 𝗹𝗮𝗺𝗯𝗱𝗮 𝗽𝗮𝗿𝗮𝗺𝗲𝘁𝗲𝗿𝘀https://lnkd.in/eqCiUCndWell worth a read 👍🏻
90
8 Comments
Like CommentTo view or add a comment, sign in
-
Dave Callan
Microsoft MVP | Senior Software Engineer | .NET Content Creator
- Report this post
.NET 8 new static code analyzers 💡I'm a big fan of using tooling where possible to help us improve our code and these new analyzers added in .NET 8 should help. Note ... CA1864 is not shown below but was also added in .NET 8 and catches occurrences of a Dictionary.Add call guarded by Dictionary.ContainsKey.Which ones will you turn on?
113
7 Comments
Like CommentTo view or add a comment, sign in
-
Dave Callan
Microsoft MVP | Senior Software Engineer | .NET Content Creator
- Report this post
𝗥𝗲𝗮𝗱𝗢𝗻𝗹𝘆𝗦𝗲𝘁<𝗧> coming in .NET 9 💡We already have ReadOnlyCollection<T> and ReadOnlyDictionary<TKey, TValue> but no ReadOnlySet<T>. A PR has been merged for this and I'd expect it to be released with .NET 9 Preview 6 in the 2nd or 3rd week of July.
109
16 Comments
Like CommentTo view or add a comment, sign in
-
Dave Callan
Microsoft MVP | Senior Software Engineer | .NET Content Creator
- Report this post
Welcome to .NET Aspire YouTube playlist ⬇️Intro to Aspire playlist, great if you haven't looked into Aspire much yet. Playlist Link -> https://lnkd.in/eN7TFhJb
149
9 Comments
Like CommentTo view or add a comment, sign in
-
Dave Callan
Microsoft MVP | Senior Software Engineer | .NET Content Creator
- Report this post
𝗚𝗲𝗻𝗲𝗿𝗶𝗰 𝗢𝗿𝗱𝗲𝗿𝗲𝗱𝗗𝗶𝗰𝘁𝗶𝗼𝗻𝗮𝗿𝘆 coming in .NET 9 🔥.NET does not currently have a genericOrderedDictionaryclass which has meant many of us have rolled own our solutions. Thankfully a PR adding a generic OrderedDictionary was merged two days ago and should be released with preview 6. This is awesome and should allow many of us to remove custom code and get the best performance from the built in implementation.
361
25 Comments
Like CommentTo view or add a comment, sign in
-
Dave Callan
Microsoft MVP | Senior Software Engineer | .NET Content Creator
- Report this post
Recommended Entity Framework YouTube playlist 💡Milan Jovanović has covered a lot of Entity Framework content on his YouTube channel over the last year, so much quality content here. Check it out -> https://lnkd.in/eHfMhEfk
168
12 Comments
Like CommentTo view or add a comment, sign in
-
Dave Callan
Microsoft MVP | Senior Software Engineer | .NET Content Creator
- Report this post
.NET 9 optimized static web asset delivery with new middleware 💡In .NET 9 (Preview 5+) 𝗠𝗮𝗽𝗦𝘁𝗮𝘁𝗶𝗰𝗔𝘀𝘀𝗲𝘁𝘀 is a new middleware that helps optimize the delivery of static assets in an app. It works with all UI frameworks, including Blazor, Razor Pages, and MVC. MapStaticAssetsoperates by combining build and publish-time processes to collect information about all the static resources in an app. This information is then utilized by the runtime library to efficiently serve these files to the browser by utilizing techniques such as 𝗯𝘂𝗶𝗹𝗱 𝘁𝗶𝗺𝗲 𝗴𝘇𝗶𝗽 𝗮𝗻𝗱 𝗯𝗿𝗼𝘁𝗹𝗶 𝗰𝗼𝗺𝗽𝗿𝗲𝘀𝘀𝗶𝗼𝗻.The image below (from MS) shows the original and compressed sizes of the CSS and JS files in the default Razor Pages template.What do you think?
167
15 Comments
Like CommentTo view or add a comment, sign in
-
Dave Callan
Microsoft MVP | Senior Software Engineer | .NET Content Creator
- Report this post
.𝗡𝗘𝗧 𝟵 𝗧𝗮𝘀𝗸.𝗪𝗵𝗲𝗻𝗘𝗮𝗰𝗵 𝗲𝘅𝗮𝗺𝗽𝗹𝗲 💡.NET 9 Preview 5 is now available and contains lots of goodies for us including the ability to 𝗲𝗮𝘀𝗶𝗹𝘆 𝗽𝗿𝗼𝗰𝗲𝘀𝘀 𝗮𝘀𝘆𝗻𝗰𝗵𝗿𝗼𝗻𝗼𝘂𝘀 𝘁𝗮𝘀𝗸𝘀 𝗮𝘀 𝘁𝗵𝗲𝘆 𝗰𝗼𝗺𝗽𝗹𝗲𝘁𝗲. The simple example below makes multipleHttpClientcalls and is able to operate on their results as they complete. What do you think?
655
42 Comments
Like CommentTo view or add a comment, sign in
-
Dave Callan
Microsoft MVP | Senior Software Engineer | .NET Content Creator
- Report this post
Vertical Slice Architecture example 💡In this simple example everything (except .cshtml) is in one file, it's very developer friendly. No hopping between multiple projects, no repository pattern, no specification pattern, no MediatR, no indirection, no abstraction fetish that we typically see in our apps, no bloat ... just enough code to meet the requirements of the use case. Of course it's not going to work for all apps and use cases but try and at least consider if this approach will work for you.
127
43 Comments
Like CommentTo view or add a comment, sign in
55,232 followers
- 1,565 Posts
- 23 Articles
View Profile
FollowMore from this author
- eShopOnWeb Architecture (16/16) - uses clean architecture Dave Callan 2y
- eShopOnWeb Architecture (15/16) – has a really nice example of the Interface Segregation Principle Dave Callan 2y
- eShopOnWeb Architecture (14/16) – uses parameterized tests Dave Callan 2y