@HumansNoContext
1. Grab forearm firmly.
2. Pull briskly down to floor.
3. Listen for broken bone.
4. Keep hold if phone available, call 911 else release.
Never open the door afterwards as there may be two of them.
Cool library for dump any object in a structured and colorful way into the Console, Trace, Debug events or your own custom output.
My simple test with EF Core 8
Just took a massive class project from .NET Framework 4.5.0 to .NET Core 7, 27 issues, all ambiguous namespacce issues fixed in 20 minutes. Entire upgrade 45 minutes. Next up, benchmarking.
EF Core tip
When using raw SQL where the statement is long, consider creating a separate method that contains the SQL as shown belong.
Benefits
🔹Cleaner code
🔹Statements are easy to drop in e.g. from SSMS
C# tip
Learn to use generics, several reasons.
🔹Reduce code redundancy
🔹Code Reusability
🔹Flexibility
🔹Type Safety
Example for reading appsettings.json
C# Challenge of the day
Given a string with numbers bracketed how would you extract to a float array?
No chance of nulls and all values will represent floats.
(answer posted tomorrow for those not playing)
Tip for C# raw string literals, storing SQL statement as shown below.
In this case, the statement was written in SSMS using RedGates SQL-Prompt. All statements are stored in a class for statements only.
Question, you have an application that has customers from different countries but for this application we only want customers from Germany, no other countries. In the country table Germany identifier is 9. With that, what is wrong with the following method
Been answering questions on many forums for years and wonder when a developer gets some experience with C# or VB .NET they never take the time to learn the basics of generics?
Example 1 allows a developer to use a CheckedListBox with a list of string or other type and keep code
Did you know that if you want a specific format passed to a method, prefix with the language.
Want a regular expression /*lang=regex*/
Want valid json /*lang=json*/
My afternoon experiment to find all interfaces in a Visual Studio solution and have zero use other than to learn something new. That is as far as it goes, compile and get the proper results.
Working on a new Core project template
- Predefined SeriLog/EF Core logging
- Option to regenerate data in database
- Flexible to work in other project types
Reason, mostly for common code patterns.
A peek.
Question came up for importing Excel to SQL-Server. Person was rather vague but took a stab at it.
Here is my solution (a newer version than post which uses both Dapper and EF Core). Uses an NuGet package ExcelMapper which works great.
Went to run an Core project this morning and received.
Your connection is not private
This is after updating Chrome.
Had to go to chrome://flags/allow and enable the following.
When writing rules for class properties using FluentValidation NuGet package where there are the same rules for various classes consider the following. Implement an interface with common properties and create a validator for them followed by including them in each class as per
Dapper/Json/SQL-Server
Was looking a Microsoft SQL-Server examples, found one on using Dapper and had a library I've not seen before for working with objects and string arrays to allow working with json.
My version
Source code
Passion outside of coding:
My
#1
passion outside of coding is driving my sports cars modified for extremely curvy roads which we have plenty of in and around Oregon. Since it rains a lot here both cars have ceramic coating on the body and windows.
What is your passion?