Currently targeting NET Core
project using System.Text.Json 7.0.0
as a Transitive Package will be flagged as high Severity using
dotnet list package --include-transitive --vulnerable
To circumvent, add the following to the project file.
var members = MemberOperations.MembersList(); | |
List<GroupedMember> groups = MemberOperations.GroupedMembers(members); | |
foreach (GroupedMember groupMember in groups) | |
{ | |
Console.WriteLine(groupMember); | |
foreach (Member member in groupMember.Lists) | |
{ | |
Console.WriteLine($"\t{member.Id,-3}{member.Active}"); | |
} |
USE tempdb | |
GO | |
-- Prepare the scene | |
CREATE TABLE #ChristmasScene | |
( |
SELECT t.name AS TableName, | |
p.rows AS [RowCount] | |
FROM sys.tables t | |
INNER JOIN sys.partitions p | |
ON t.object_id = p.object_id | |
WHERE p.index_id IN ( 0, 1 ) | |
ORDER BY p.rows DESC, | |
t.name; |
/* | |
* var pastDate = new Date('2014-10-01T02:30'); | |
* var message = fromNow(pastDate); | |
* //=> '2 days ago' | |
* | |
* @param {Date} Native JavaScript Date object | |
* @return {string} | |
*/ | |
function fromNow(date) { | |
var seconds = Math.floor((new Date() - date) / 1000); |
using System.Text.RegularExpressions; | |
namespace Net9Features; | |
internal class Program | |
{ | |
static void Main(string[] args) | |
{ | |
const string sentence = "a test to see if"; |
public partial class Demo | |
{ | |
[OverloadResolutionPriority(2)] | |
public static void DisplayInvoice(string invoice ) | |
{ | |
Console.WriteLine($"invoice: {NextValue(invoice)}"); | |
} | |
[OverloadResolutionPriority(-1)] | |
public static void DisplayInvoice(string invoice, int count = 3) |
Currently targeting NET Core
project using System.Text.Json 7.0.0
as a Transitive Package will be flagged as high Severity using
dotnet list package --include-transitive --vulnerable
To circumvent, add the following to the project file.
using yournamespace.Data; | |
using Microsoft.EntityFrameworkCore.Infrastructure; | |
using Microsoft.EntityFrameworkCore.Storage; | |
namespace yournamespace.Classes; | |
internal class EntityHelpers | |
{ | |
public static bool DatabaseExists() | |
{ | |
using var context = new Context(); |
List<Item> items = | |
[ | |
new() { Id = 1,Name = "100"}, | |
new() { Id = 2,Name = "100"}, | |
new() { Id = 3,Name = "100" } | |
]; | |
string json = JsonSerializer.Serialize(items, Options); |
internal static partial class Extensions | |
{ | |
/// <summary> | |
/// Paginates the elements of an <see cref="IQueryable{TSource}"/> based on the specified page number and page size. | |
/// </summary> | |
/// <typeparam name="TSource">The type of the elements of the source.</typeparam> | |
/// <param name="source">The source <see cref="IQueryable{TSource}"/> to paginate.</param> | |
/// <param name="page">The page number to retrieve. Must be greater than or equal to 1.</param> | |
/// <param name="pageSize">The number of elements per page. Must be greater than or equal to 1.</param> |