From 6d977f0e85a6cc68e3be2b48d06880d893eb288e Mon Sep 17 00:00:00 2001 From: Paul Lovy Date: Mon, 16 Nov 2020 16:05:42 -0500 Subject: [PATCH] remove bitwise &, add logical && --- src/WebApiContrib.Formatting.Xlsx/XlsxMediaTypeFormatter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/WebApiContrib.Formatting.Xlsx/XlsxMediaTypeFormatter.cs b/src/WebApiContrib.Formatting.Xlsx/XlsxMediaTypeFormatter.cs index 3adbbc1..894c02f 100644 --- a/src/WebApiContrib.Formatting.Xlsx/XlsxMediaTypeFormatter.cs +++ b/src/WebApiContrib.Formatting.Xlsx/XlsxMediaTypeFormatter.cs @@ -176,7 +176,7 @@ public override Task WriteToStreamAsync(Type type, object value, System.IO.Strea var metadata = ModelMetadataProviders.Current.GetMetadataForType(null, itemType); var properties = (from p in itemType.GetProperties() - where p.CanRead & p.GetGetMethod().IsPublic & p.GetGetMethod().GetParameters().Length == 0 + where p.CanRead && p.GetGetMethod().IsPublic && p.GetGetMethod().GetParameters().Length == 0 select p).ToList(); @@ -236,7 +236,7 @@ public override Task WriteToStreamAsync(Type type, object value, System.IO.Strea else if (info.ExcelAttribute != null && info.ExcelAttribute.FalseValue != null && cellValue.Equals("False")) row.Add(info.ExcelAttribute.FalseValue); - else if (!string.IsNullOrWhiteSpace(info.FormatString) & string.IsNullOrEmpty(info.ExcelNumberFormat)) + else if (!string.IsNullOrWhiteSpace(info.FormatString) && string.IsNullOrEmpty(info.ExcelNumberFormat)) row.Add(string.Format(info.FormatString, cellValue)); else