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

@KarenPayneMVP

Followers
5,484
Following
108
Media
1,728
Statuses
6,813

Microsoft MVP x 10, 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.
Explore trending content on Musk Viewer
Pinned Tweet
@KarenPayneMVP
Karen Payne MVP
11 months
Did you know when logging exceptions you can remove the path to lines of code?
Tweet media one
29
91
695
@KarenPayneMVP
Karen Payne MVP
3 months
When writing code, do you include empty lines for readability?
Tweet media one
464
59
1K
@KarenPayneMVP
Karen Payne MVP
6 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
34
298
@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
11
283
@KarenPayneMVP
Karen Payne MVP
6 months
EF Core 8: TimeOnly.IsBetween Code sample
Tweet media one
8
33
269
@KarenPayneMVP
Karen Payne MVP
6 months
Are you using FluentValidation? Did you know about including rules? Using Include can help in reusability.
Tweet media one
11
29
271
@KarenPayneMVP
Karen Payne MVP
6 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
252
@KarenPayneMVP
Karen Payne MVP
1 year
C# tip: Get rid of "using static"
Tweet media one
10
29
232
@KarenPayneMVP
Karen Payne MVP
2 months
Tweet media one
16
33
226
@KarenPayneMVP
Karen Payne MVP
10 months
Visual Studio tip: many of Microsoft methods provide sample usage by pressing CTRL+ALT+'
Tweet media one
9
37
216
@KarenPayneMVP
Karen Payne MVP
4 months
How to download files from the web in a .csproj file.
Tweet media one
11
19
205
@KarenPayneMVP
Karen Payne MVP
4 months
Setup for EF Core configuration for development, staging and production.
Tweet media one
12
22
198
@KarenPayneMVP
Karen Payne MVP
5 months
Did you know about pseudovariable $returnvalue to the return value of a .NET method?
Tweet media one
20
18
192
@KarenPayneMVP
Karen Payne MVP
5 months
Did you know about adding a dependency by dragging and dropping?
13
22
190
@KarenPayneMVP
Karen Payne MVP
5 months
Have you worked with implicit operator? (My focus for today)
Tweet media one
31
18
182
@KarenPayneMVP
Karen Payne MVP
3 months
Chinook is a sample database available for SQL Server, Oracle, MySQL. Good database to learn from.
Tweet media one
1
40
182
@KarenPayneMVP
Karen Payne MVP
2 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
39
17
176
@KarenPayneMVP
Karen Payne MVP
3 months
Question of the day In-line SQL or Stored Procedure ❓ #sql #dapper #storedprocedure
Tweet media one
77
15
175
@KarenPayneMVP
Karen Payne MVP
6 months
Question of the day Primary constructors (1) or conventional (2)?
Tweet media one
96
10
170
@KarenPayneMVP
Karen Payne MVP
1 month
Question of the day (T-SQL) There are two choices, CASE or IIF ?
Tweet media one
54
21
173
@KarenPayneMVP
Karen Payne MVP
4 months
Question of the day When not using records which is your preference?
Tweet media one
73
18
163
@KarenPayneMVP
Karen Payne MVP
5 months
In Visual Studio, do have this option checked/enabled? If not you should.
Tweet media one
8
19
154
@KarenPayneMVP
Karen Payne MVP
2 years
Think it was 20 years ago when I dropped Borland Delphi for .NET
14
1
147
@KarenPayneMVP
Karen Payne MVP
1 month
FluentValidation InlineValidator example 🔹Person model uses Inline validation 🔹Developer model regular validator
Tweet media one
3
18
144
@KarenPayneMVP
Karen Payne MVP
3 months
Tweet media one
13
12
143
@KarenPayneMVP
Karen Payne MVP
2 months
How to mask a credit card number
Tweet media one
7
17
144
@KarenPayneMVP
Karen Payne MVP
5 months
Question of the day Which is your preference? (do not overthink localization)
Tweet media one
125
16
143
@KarenPayneMVP
Karen Payne MVP
7 months
Question of the day: brackets or no brackets?
Tweet media one
198
8
137
@KarenPayneMVP
Karen Payne MVP
8 days
What are your essential Visual Studio extensions❓ Mine 📍 EF Core Power Tools 📍 ReSharper 📍 Markdown Editor 📍 Image preview
35
9
134
@KarenPayneMVP
Karen Payne MVP
5 months
Question of the day Do you use the stash feature of Git in Visual Studio?
Tweet media one
106
4
132
@KarenPayneMVP
Karen Payne MVP
5 months
Colorize runtime exceptions Source
Tweet media one
13
18
134
@KarenPayneMVP
Karen Payne MVP
5 months
Question of the day Validate Birth date using DataAnnotations (1) or FluentValidation (2)?
Tweet media one
26
17
131
@KarenPayneMVP
Karen Payne MVP
7 months
Question of the day Which is your preferred null check?
Tweet media one
114
11
128
@KarenPayneMVP
Karen Payne MVP
5 months
Did you know Enum.TryParse has a ignore case option?
Tweet media one
5
10
130
@KarenPayneMVP
Karen Payne MVP
1 year
EF Core dynamic order by
Tweet media one
2
21
125
@KarenPayneMVP
Karen Payne MVP
4 months
Some useful enum helper methods. Source
Tweet media one
10
15
125
@KarenPayneMVP
Karen Payne MVP
4 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
12
125
@KarenPayneMVP
Karen Payne MVP
9 months
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
117
@KarenPayneMVP
Karen Payne MVP
6 months
Streaming deserialization APIs (C #12 ) Source
Tweet media one
7
10
117
@KarenPayneMVP
Karen Payne MVP
6 months
Serilog.AspNetCore is .NET Core 8 ready 😀
3
6
118
@KarenPayneMVP
Karen Payne MVP
1 month
Essential VS2022 extensions (free) 🧵 Feel free to add yours/
15
20
118
@KarenPayneMVP
Karen Payne MVP
4 months
Question of the day Use this or not?
Tweet media one
119
9
114
@KarenPayneMVP
Karen Payne MVP
6 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
116
@KarenPayneMVP
Karen Payne MVP
8 months
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
113
@KarenPayneMVP
Karen Payne MVP
5 months
SQL-Server Dynamic data masking Documentation
Tweet media one
4
12
110
@KarenPayneMVP
Karen Payne MVP
2 months
On the wall at Microsoft.
Tweet media one
8
2
113
@KarenPayneMVP
Karen Payne MVP
5 months
Question of the day Preference?
Tweet media one
74
10
110
@KarenPayneMVP
Karen Payne MVP
5 months
Question of the day Single character or full name variable in Lambda?
Tweet media one
77
7
107
@KarenPayneMVP
Karen Payne MVP
4 months
System.Text.Json rearrange order of properties during serialization.
Tweet media one
6
13
111
@KarenPayneMVP
Karen Payne MVP
3 months
What is your choice?
Tweet media one
57
8
105
@KarenPayneMVP
Karen Payne MVP
1 month
Question on C# validators What is your preference? I prefer FluentValidation over Data annotations
31
5
107
@KarenPayneMVP
Karen Payne MVP
4 months
Any interest in creating dotnet tools? Below is a sample with an interface using Spectre.Console, accessing SQL-Server databases.
2
9
107
@KarenPayneMVP
Karen Payne MVP
5 months
Side project of the day Update NET5 to NET8
Tweet media one
6
6
106
@KarenPayneMVP
Karen Payne MVP
2 months
Tweet media one
61
6
103
@KarenPayneMVP
Karen Payne MVP
5 months
Question of the day Method 1 or 2?
Tweet media one
65
4
102
@KarenPayneMVP
Karen Payne MVP
6 months
EF Core 8 - Computed columns Source code, part of an ongoing repository for EF Core 8
Tweet media one
2
12
102
@KarenPayneMVP
Karen Payne MVP
22 days
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
9 months
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
4
18
97
@KarenPayneMVP
Karen Payne MVP
3 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
99
@KarenPayneMVP
Karen Payne MVP
3 months
Question of the day Do you have a clean Program.cs ?
Tweet media one
25
6
96
@KarenPayneMVP
Karen Payne MVP
4 months
Reading app.config in NET8
Tweet media one
1
15
97
@KarenPayneMVP
Karen Payne MVP
3 months
Question of the day Statement body or inverted?
Tweet media one
89
12
95
@KarenPayneMVP
Karen Payne MVP
5 months
EF Core SaveChanges/Interceptor audit to json and log to file using SeriLog. Source
Tweet media one
2
10
95
@KarenPayneMVP
Karen Payne MVP
6 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
10
96
@KarenPayneMVP
Karen Payne MVP
5 months
Aliasing C #12 stored in GlobalUsing.cs for bool.
Tweet media one
20
7
94
@KarenPayneMVP
Karen Payne MVP
2 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
95
@KarenPayneMVP
Karen Payne MVP
1 month
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
10
1
94
@KarenPayneMVP
Karen Payne MVP
3 months
I like how easy it is to write extensions for FluentValidation. #csharp #FluentValidation
Tweet media one
0
8
93
@KarenPayneMVP
Karen Payne MVP
13 days
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
12 days
Extract numbers from a string
Tweet media one
5
13
92
@KarenPayneMVP
Karen Payne MVP
2 months
Here are a couple of useful string extension methods.
Tweet media one
4
14
91
@KarenPayneMVP
Karen Payne MVP
2 months
When adding a new record to a Microsoft SQL-Server table using C#, there are two ways to write an INSERT statement. The first, using two queries, second a single query. Note: In the OUTPUT, Id is the property in a Person class and the primary key.
Tweet media one
3
14
92
@KarenPayneMVP
Karen Payne MVP
3 months
Question of the day 2⃣
Tweet media one
59
10
89
@KarenPayneMVP
Karen Payne MVP
3 months
@curtis_focusp 67 years old and going strong.
6
4
90
@KarenPayneMVP
Karen Payne MVP
3 months
Question of the day Do you write test?
Tweet media one
58
4
87
@KarenPayneMVP
Karen Payne MVP
6 months
Question of the day Do you use compiled queries for EF Core? (and know when to use them)
Tweet media one
7
8
90
@KarenPayneMVP
Karen Payne MVP
5 months
Question of the day Convention method (1) or Extension method (2)
Tweet media one
48
11
86
@KarenPayneMVP
Karen Payne MVP
6 months
New for Data Annotations in net8 AllowedValuesAttribute and DeniedValuesAttribute Note that AllowedValues is case sensitive.
Tweet media one
3
5
86
@KarenPayneMVP
Karen Payne MVP
4 months
Simple example for IComparer<T> and primary constructors.
Tweet media one
1
6
85
@KarenPayneMVP
Karen Payne MVP
2 months
Clone a record tip
Tweet media one
3
11
87
@KarenPayneMVP
Karen Payne MVP
4 months
Nice NuGet package to interrogate SQL statements.
Tweet media one
3
7
86
@KarenPayneMVP
Karen Payne MVP
5 months
Just took a class with 164 lines of code using connection, command objects and parameters to 64 lines with Dapper with DataTable not list. Prior code
Tweet media one
14
9
83
@KarenPayneMVP
Karen Payne MVP
1 year
Simple method to validate a connection string for Core or Razor Pages. Connectionstrings models ConnectionStrings in appsettings.json
Tweet media one
1
12
82
@KarenPayneMVP
Karen Payne MVP
1 month
For Visual Studio where do you store projects? - C:\VisualStudio - C:\VisualStudio2022 - Other
214
4
83
@KarenPayneMVP
Karen Payne MVP
6 months
Collection Expressions (C #12 ) done with a model rather than a list of int like I've seen time and time again. Source
Tweet media one
7
5
84
@KarenPayneMVP
Karen Payne MVP
23 days
Some benefits for using Dapper 1⃣ No need to open/close a connection 2⃣ Supports Stored Procedures 3⃣ Less code than conventional methods What are you favorites? #csharp #dapper
Tweet media one
6
9
84
@KarenPayneMVP
Karen Payne MVP
5 months
Question of the day Which method would use to read values from appsettings.json?
Tweet media one
43
8
81
@KarenPayneMVP
Karen Payne MVP
4 months
Tip for DistinctBy You can pass more than one property. Source
Tweet media one
4
11
83
@KarenPayneMVP
Karen Payne MVP
2 months
C# Source Generated RegEx Instructs the System.Text.RegularExpressions source generator to generate an implementation of the specified regular expression. #csharp #net7 #Dotnet
Tweet media one
2
5
82
@KarenPayneMVP
Karen Payne MVP
3 months
Oracle and uppercase column names 😳
Tweet media one
20
6
81
@KarenPayneMVP
Karen Payne MVP
6 months
While working with EF Core 8 got side tracked taking SQL to different methods to translate the SQL below. Question of the day Which version would you use? (BenchmarkDotNet results are very close)
Tweet media one
10
5
81
@KarenPayneMVP
Karen Payne MVP
5 months
Learn the basics to working with generics in C# and code reuse. Windows forms was used so that its easier to understand but what is shown once understood its easy to transfer to other project types. One example of many
Tweet media one
1
11
80
@KarenPayneMVP
Karen Payne MVP
7 months
One of the best features I think for, in this case C# are extension methods yet there are developers 🔹Who don't care for them 🔹That are unaware of them Example from a question asked at Microsoft forums. Then there are developers who write code in a
Tweet media one
Tweet media two
Tweet media three
8
10
79
@KarenPayneMVP
Karen Payne MVP
4 months
SSMS Question What is your favorite extension? Mine is Redgate Search
Tweet media one
11
6
80
@KarenPayneMVP
Karen Payne MVP
5 months
C# Christmas tree
2
10
78
@KarenPayneMVP
Karen Payne MVP
2 months
Do you know about the site CodeMaze? The site has a wealth of great information and in many cases has benchmarks. Good example, can a string represent an int for instance. My versions.
Tweet media one
7
9
78
@KarenPayneMVP
Karen Payne MVP
7 months
What is your style?
Tweet media one
112
8
76
@KarenPayneMVP
Karen Payne MVP
5 months
Question of the day Which is your preference, conventional or collection initialization?
Tweet media one
50
3
77