Skip to content

Instantly share code, notes, and snippets.

View vbilopav's full-sized avatar
🏠
Working from home

Vedran Bilopavlović vbilopav

🏠
Working from home
View GitHub Profile
@vbilopav
vbilopav / JsonValidator.cs
Last active May 23, 2023 11:11
Utility function in C# which validates JSON string against .NET model type by using Newtonsoft Json library.
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Serialization;
namespace MyNamespace;
public static class JsonValidator
{
public static bool IsJsonValidType(this string json, Type modelType, out string? message)
{
try
@tpetrina
tpetrina / DataServiceAsyncExtensions
Created April 1, 2012 17:28
Wrappers for asynchronous operations exposed by DataServiceQuery<T> and DataServiceContext
// Use in VS11 and .NET 4.5 or in VS10 with the Async CTP installed
//
namespace DataServiceAsyncExtensions
{
using System;
using System.Collections.Generic;
using System.Data.Services.Client;
using System.Threading.Tasks;