Skip to content

Instantly share code, notes, and snippets.

View nickalbrecht's full-sized avatar

Nick Albrecht nickalbrecht

View GitHub Profile
@nickalbrecht
nickalbrecht / EndpointBehavior.cs
Last active January 21, 2018 21:46
Series of functions and classes for using SSRS to run reports from inside an ASP.NET Core application
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Dispatcher;
internal class ReportingServicesEndpointBehavior : IEndpointBehavior
{
public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters) { }
public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
{
@nickalbrecht
nickalbrecht / SelectListExtensionMethods.cs
Last active November 5, 2022 19:57
SelectListItem Extension Methods for DropDowns in MVC Core. Added ability to specify the option's Group, and for some bug fixes, more XML docs
public static class SelectListExtensionMethods
{
/// <summary>
/// The SelectListItem to use by default as the placeholder for select lists generated by these extension methods when the user needs to pick a value.
/// </summary>
public static readonly SelectListItem DefaultEmptySelectListItem = new SelectListItem() { Text = "-- Pick One --", Value = string.Empty };
/// <summary>
/// The SelectListItem to use by default as the placeholder for select lists generated by these extension methods when not picking a value is the same as using as of the possible choices (meant for filtering typically)
/// </summary>
public static readonly SelectListItem AnySelectListItem = new SelectListItem() { Text = "-- Any --", Value = string.Empty };