Karen Payne MVP Profile Banner
Karen Payne MVP Profile
Karen Payne MVP

@KarenPayneMVP

6,167
Followers
137
Following
2,039
Media
8,014
Statuses

Microsoft MVP 11, passion for sports cars 🏎, Microsoft technology📠, teacher, She,her,hers. 🟢 Developer advocate

Oregon USA
Joined July 2009
Don't wanna be here? Send us removal request.
Pinned Tweet
@KarenPayneMVP
Karen Payne MVP
1 year
Did you know when logging exceptions you can remove the path to lines of code?
Tweet media one
31
94
716
@KarenPayneMVP
Karen Payne MVP
8 months
When writing code, do you include empty lines for readability?
Tweet media one
451
57
1K
@KarenPayneMVP
Karen Payne MVP
3 months
@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.
10
6
436
@KarenPayneMVP
Karen Payne MVP
10 months
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
Tweet media one
10
33
291
@KarenPayneMVP
Karen Payne MVP
5 months
So @Dave_DotNet caught someone using my code without crediting me. After I asked why they praised me but also said I was impulsive, really?
Tweet media one
50
15
285
@KarenPayneMVP
Karen Payne MVP
2 years
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.
25
12
276
@KarenPayneMVP
Karen Payne MVP
10 months
Are you using FluentValidation? Did you know about including rules? Using Include can help in reusability.
Tweet media one
10
28
264
@KarenPayneMVP
Karen Payne MVP
11 months
EF Core 8: TimeOnly.IsBetween Code sample
Tweet media one
8
33
257
@KarenPayneMVP
Karen Payne MVP
11 months
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
Tweet media one
21
24
245
@KarenPayneMVP
Karen Payne MVP
2 months
@il0venostalgia Shook hands with president Kennedy.
13
1
231
@KarenPayneMVP
Karen Payne MVP
1 year
C# tip: Get rid of "using static"
Tweet media one
10
29
224
@KarenPayneMVP
Karen Payne MVP
7 months
Tweet media one
16
33
223
@KarenPayneMVP
Karen Payne MVP
1 year
Visual Studio tip: many of Microsoft methods provide sample usage by pressing CTRL+ALT+'
Tweet media one
9
37
214
@KarenPayneMVP
Karen Payne MVP
4 months
@Star_Knight12 I'll stick with C#
17
3
204
@KarenPayneMVP
Karen Payne MVP
8 months
How to download files from the web in a .csproj file.
Tweet media one
11
18
199
@KarenPayneMVP
Karen Payne MVP
8 months
Setup for EF Core configuration for development, staging and production.
Tweet media one
12
22
194
@KarenPayneMVP
Karen Payne MVP
3 months
C# tip Learn to use generics, several reasons. 🔹Reduce code redundancy 🔹Code Reusability 🔹Flexibility 🔹Type Safety Example for reading appsettings.json
Tweet media one
4
21
198
@KarenPayneMVP
Karen Payne MVP
10 months
Did you know about pseudovariable $returnvalue to the return value of a .NET method?
Tweet media one
19
17
189
@KarenPayneMVP
Karen Payne MVP
10 months
Did you know about adding a dependency by dragging and dropping?
13
21
184
@KarenPayneMVP
Karen Payne MVP
10 months
Have you worked with implicit operator? (My focus for today)
Tweet media one
31
16
178
@KarenPayneMVP
Karen Payne MVP
8 months
Chinook is a sample database available for SQL Server, Oracle, MySQL. Good database to learn from.
Tweet media one
1
40
180
@KarenPayneMVP
Karen Payne MVP
7 months
Question When interacting with databases, do you write asynchronous or synchronous methods or both? And yes stored procedures were not used here.
Tweet media one
38
16
171
@KarenPayneMVP
Karen Payne MVP
8 months
Question of the day In-line SQL or Stored Procedure ❓ #sql #dapper #storedprocedure
Tweet media one
76
14
170
@KarenPayneMVP
Karen Payne MVP
3 months
Using aliasing, give useful names to a Dictionary. (Its not for everyone)
Tweet media one
26
15
173
@KarenPayneMVP
Karen Payne MVP
10 months
Question of the day Primary constructors (1) or conventional (2)?
Tweet media one
92
10
167
@KarenPayneMVP
Karen Payne MVP
2 months
@MAstronomers Time to clear the planet for the next experiment.
4
2
168
@KarenPayneMVP
Karen Payne MVP
6 months
Question of the day (T-SQL) There are two choices, CASE or IIF ?
Tweet media one
53
21
167
@KarenPayneMVP
Karen Payne MVP
3 months
Tweet media one
21
0
167
@KarenPayneMVP
Karen Payne MVP
9 months
Question of the day When not using records which is your preference?
Tweet media one
71
17
156
@KarenPayneMVP
Karen Payne MVP
3 months
One of the best features for .NET are extension methods. Check out a site dedicated to extension methods.
4
20
158
@KarenPayneMVP
Karen Payne MVP
10 months
In Visual Studio, do have this option checked/enabled? If not you should.
Tweet media one
8
19
150
@KarenPayneMVP
Karen Payne MVP
1 month
New disc
Tweet media one
10
2
147
@KarenPayneMVP
Karen Payne MVP
2 months
Which is your perference?
Tweet media one
64
12
147
@KarenPayneMVP
Karen Payne MVP
3 years
Think it was 20 years ago when I dropped Borland Delphi for .NET
14
1
146
@KarenPayneMVP
Karen Payne MVP
3 months
Curious, any developers use Total Commander? Great tool, I've integrated VS Code in to the toolbar.
Tweet media one
48
6
146
@KarenPayneMVP
Karen Payne MVP
6 months
How to mask a credit card number
Tweet media one
7
17
142
@KarenPayneMVP
Karen Payne MVP
10 months
Question of the day Which is your preference? (do not overthink localization)
Tweet media one
121
15
139
@KarenPayneMVP
Karen Payne MVP
6 months
FluentValidation InlineValidator example 🔹Person model uses Inline validation 🔹Developer model regular validator
Tweet media one
3
18
138
@KarenPayneMVP
Karen Payne MVP
8 months
Tweet media one
13
10
137
@KarenPayneMVP
Karen Payne MVP
11 months
Question of the day: brackets or no brackets?
Tweet media one
195
8
131
@KarenPayneMVP
Karen Payne MVP
3 months
C# developers do you use NodaTime?
Tweet media one
20
10
133
@KarenPayneMVP
Karen Payne MVP
5 months
What are your essential Visual Studio extensions❓ Mine 📍 EF Core Power Tools 📍 ReSharper 📍 Markdown Editor 📍 Image preview
35
9
133
@KarenPayneMVP
Karen Payne MVP
10 months
Colorize runtime exceptions Source
Tweet media one
12
18
130
@KarenPayneMVP
Karen Payne MVP
10 months
Question of the day Validate Birth date using DataAnnotations (1) or FluentValidation (2)?
Tweet media one
25
17
128
@KarenPayneMVP
Karen Payne MVP
10 months
Did you know Enum.TryParse has a ignore case option?
Tweet media one
5
10
128
@KarenPayneMVP
Karen Payne MVP
11 months
Question of the day Which is your preferred null check?
Tweet media one
110
11
125
@KarenPayneMVP
Karen Payne MVP
5 months
C# efficient extension method to split strings like KarenPayne to Karen Payne, #csharp #dotnet
Tweet media one
9
8
127
@KarenPayneMVP
Karen Payne MVP
9 months
Question of the day Do you use the stash feature of Git in Visual Studio?
Tweet media one
105
4
128
@KarenPayneMVP
Karen Payne MVP
1 year
EF Core dynamic order by
Tweet media one
2
20
119
@KarenPayneMVP
Karen Payne MVP
2 months
@OliLondonTV The real problem is letting these boxers allowed to box in the first place.
1
4
125
@KarenPayneMVP
Karen Payne MVP
9 months
Some useful enum helper methods. Source
Tweet media one
10
14
119
@KarenPayneMVP
Karen Payne MVP
9 months
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)
Tweet media one
29
11
118
@KarenPayneMVP
Karen Payne MVP
1 year
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.
Tweet media one
14
16
115
@KarenPayneMVP
Karen Payne MVP
2 months
C# the in keyword
Tweet media one
7
11
118
@KarenPayneMVP
Karen Payne MVP
6 months
Essential VS2022 extensions (free) 🧵 Feel free to add yours/
15
20
117
@KarenPayneMVP
Karen Payne MVP
9 months
Question of the day Use this or not?
Tweet media one
118
8
111
@KarenPayneMVP
Karen Payne MVP
11 months
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
Tweet media one
33
10
113
@KarenPayneMVP
Karen Payne MVP
11 months
Serilog.AspNetCore is .NET Core 8 ready 😀
3
6
113
@KarenPayneMVP
Karen Payne MVP
10 months
Streaming deserialization APIs (C #12 ) Source
Tweet media one
6
10
111
@KarenPayneMVP
Karen Payne MVP
7 months
On the wall at Microsoft.
Tweet media one
8
2
111
@KarenPayneMVP
Karen Payne MVP
1 year
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
Tweet media one
Tweet media two
Tweet media three
11
13
111
@KarenPayneMVP
Karen Payne MVP
9 months
SQL-Server Dynamic data masking Documentation
Tweet media one
4
12
106
@KarenPayneMVP
Karen Payne MVP
10 months
Question of the day Single character or full name variable in Lambda?
Tweet media one
75
7
102
@KarenPayneMVP
Karen Payne MVP
9 months
System.Text.Json rearrange order of properties during serialization.
Tweet media one
6
13
107
@KarenPayneMVP
Karen Payne MVP
10 months
Question of the day Preference?
Tweet media one
72
10
108
@KarenPayneMVP
Karen Payne MVP
3 months
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*/
Tweet media one
6
7
110
@KarenPayneMVP
Karen Payne MVP
3 months
SeriLog: Preserving Object Structure
Tweet media one
2
12
107
@KarenPayneMVP
Karen Payne MVP
23 days
An example for custom formatting using IFormattable. #dotnet #csharp
Tweet media one
0
18
108
@KarenPayneMVP
Karen Payne MVP
6 months
Question on C# validators What is your preference? I prefer FluentValidation over Data annotations
30
5
105
@KarenPayneMVP
Karen Payne MVP
9 months
Any interest in creating dotnet tools? Below is a sample with an interface using Spectre.Console, accessing SQL-Server databases.
2
9
105
@KarenPayneMVP
Karen Payne MVP
8 months
What is your choice?
Tweet media one
55
7
101
@KarenPayneMVP
Karen Payne MVP
9 months
Side project of the day Update NET5 to NET8
Tweet media one
6
6
104
@KarenPayneMVP
Karen Payne MVP
2 months
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.
Tweet media one
7
7
103
@KarenPayneMVP
Karen Payne MVP
7 months
Tweet media one
60
5
101
@KarenPayneMVP
Karen Payne MVP
2 months
What type of developer are you? Given a foreach (no for) and you need the index.
Tweet media one
55
10
102
@KarenPayneMVP
Karen Payne MVP
5 months
Question Who is actively working on enterprise solutions using Blazor in a fulltime job? Not looking for those who have side projects.
76
8
101
@KarenPayneMVP
Karen Payne MVP
11 months
EF Core 8 - Computed columns Source code, part of an ongoing repository for EF Core 8
Tweet media one
2
12
100
@KarenPayneMVP
Karen Payne MVP
9 months
Question of the day Method 1 or 2?
Tweet media one
64
4
97
@KarenPayneMVP
Karen Payne MVP
1 year
Decided to start writing an article on how to setup WHERE IN for a data provider and EF Core, looking good so far. #csharp #SQL #efcore
Tweet media one
3
18
97
@KarenPayneMVP
Karen Payne MVP
3 months
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.
Tweet media one
2
9
98
@KarenPayneMVP
Karen Payne MVP
4 months
For those developers using Bogus, the following shows an alternate way to generate data.
Tweet media one
2
10
99
@KarenPayneMVP
Karen Payne MVP
2 months
How many monitors do you have?
Tweet media one
75
5
96
@KarenPayneMVP
Karen Payne MVP
9 months
Reading app.config in NET8
Tweet media one
1
14
95
@KarenPayneMVP
Karen Payne MVP
8 months
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.
Tweet media one
12
14
97
@KarenPayneMVP
Karen Payne MVP
8 months
Question of the day Do you have a clean Program.cs ?
Tweet media one
25
6
92
@KarenPayneMVP
Karen Payne MVP
10 months
EF Core SaveChanges/Interceptor audit to json and log to file using SeriLog. Source
Tweet media one
2
10
94
@KarenPayneMVP
Karen Payne MVP
8 months
Question of the day Statement body or inverted?
Tweet media one
87
12
93
@KarenPayneMVP
Karen Payne MVP
2 months
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.
Tweet media one
2
21
96
@KarenPayneMVP
Karen Payne MVP
7 months
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
Tweet media one
3
13
93
@KarenPayneMVP
Karen Payne MVP
10 months
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
Tweet media one
0
9
92
@KarenPayneMVP
Karen Payne MVP
10 months
Aliasing C #12 stored in GlobalUsing.cs for bool.
Tweet media one
20
7
92
@KarenPayneMVP
Karen Payne MVP
5 months
Currently converting a .NET Framework 4.6 class proect to .NET Core 8, my wheelhouse in that is one of my specialties.
15
1
93
@KarenPayneMVP
Karen Payne MVP
8 months
I like how easy it is to write extensions for FluentValidation. #csharp #FluentValidation
Tweet media one
0
8
89
@KarenPayneMVP
Karen Payne MVP
6 months
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?
Tweet media one
9
1
91
@KarenPayneMVP
Karen Payne MVP
5 months
Extract numbers from a string
Tweet media one
5
12
90
@KarenPayneMVP
Karen Payne MVP
7 months
Here are a couple of useful string extension methods.
Tweet media one
4
14
85