Add project files.

This commit is contained in:
Thomas Savine
2020-03-06 16:07:06 +00:00
parent e7b186c7e3
commit 70de9715ce
300 changed files with 43679 additions and 0 deletions
@@ -0,0 +1,38 @@
using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.AspNetCore.Mvc.ModelBinding.Binders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Sarand.OperationsMgr.Web.System
{
//=======================================================================
/// <summary>
/// Maps a browser request to a data object. Default class provides a base implementation of a model binder.
/// <para>Overridden to trim whitespace from input values.</para>
/// </summary>
public class OpnModelBinderProvider : IModelBinderProvider
{
//-------------------------------------------------------------------
public OpnModelBinderProvider ()
{
}
//-------------------------------------------------------------------
public IModelBinder GetBinder (ModelBinderProviderContext context)
{
if (context == null) throw new ArgumentNullException(nameof(context));
// Intercept String form values.
if (context.Metadata.ModelType == typeof(string))
return new BinderTypeModelBinder(typeof(OpnModelBinder));
// Default - return null so that default binding provider is used.
return null;
}
//-------------------------------------------------------------------
}
//=======================================================================
}