LCOV - code coverage report
Current view: top level - Cqrs.Web.Mvc - NullableGuidBinder.cs Hit Total Coverage
Test: doc-coverage.info Lines: 0 2 0.0 %
Date: 2017-07-26

          Line data    Source code
       1             : #region Copyright
       2             : // // -----------------------------------------------------------------------
       3             : // // <copyright company="cdmdotnet Limited">
       4             : // //   Copyright cdmdotnet Limited. All rights reserved.
       5             : // // </copyright>
       6             : // // -----------------------------------------------------------------------
       7             : #endregion
       8             : 
       9             : using System;
      10             : using System.ComponentModel;
      11             : using System.Web.Mvc;
      12             : 
      13             : namespace Cqrs.Web.Mvc
      14             : {
      15             :         public class NullableGuidBinder : DefaultModelBinder
      16           0 :         {
      17           0 :                 protected override object GetPropertyValue(ControllerContext controllerContext, ModelBindingContext bindingContext, PropertyDescriptor propertyDescriptor, IModelBinder propertyBinder)
      18             :                 {
      19             :                         if (propertyDescriptor.PropertyType == typeof(Guid))
      20             :                         {
      21             :                                 object rawValue = base.GetPropertyValue(controllerContext, bindingContext, propertyDescriptor, propertyBinder);
      22             :                                 if (rawValue == null)
      23             :                                         return Guid.Empty;
      24             :                                 return rawValue;
      25             :                         }
      26             :                         return base.GetPropertyValue(controllerContext, bindingContext, propertyDescriptor, propertyBinder);
      27             :                 }
      28             :         }
      29             : }

Generated by: LCOV version 1.10