Skip to content

Instantly share code, notes, and snippets.

View garethj-msft's full-sized avatar

Gareth Jones garethj-msft

View GitHub Profile
@garethj-msft
garethj-msft / gist:4cfce0f84b91c857a4dc4e27f7856789
Created January 28, 2021 04:40
OData Custom Serializer for Edm.Stream
using System.IO;
using System.Reflection;
using Microsoft.AspNet.OData;
using Microsoft.AspNet.OData.Formatter;
using Microsoft.AspNetCore.Http.Extensions;
using Microsoft.OData;
namespace SMSOrgView
{
using Microsoft.AspNet.OData.Formatter.Serialization;
@garethj-msft
garethj-msft / disableOptimizeDll.ps1
Created May 17, 2017 16:58
PowerShell to turn off JIT optimization for all DLLs in a directory
$path = get-location
$files = get-Childitem $path -recurse -include *.dll
$content = "[.NET Framework Debugging Control]`r`nGenerateTrackingInfo=1`r`nAllowOptimize=0"
$count
foreach ($file in $files)
{
if ($file.fullname.contains(".dll") -or $file.fullname.contains(".DLL"))
{
@garethj-msft
garethj-msft / gist:33035a364ddc2c59911a
Created May 10, 2014 02:42
PathHandler to support more traditional URI route conventions for id references for ODataControllers for V4
/// <summary>
/// Path handler to switch to using segment notation for collection IDs
/// </summary>
internal class SegmentIdPathHandler : DefaultODataPathHandler
{
/// <summary>
/// Handle URI's using either ID format on the way in to the API
/// </summary>
protected override ODataPathSegment ParseAtCollection(IEdmModel model, ODataPathSegment previous, IEdmType previousEdmType, string segment, Queue<string> segments)
{