c# argument suffix question

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 anos atrás

        public override DBProductCollection GetAllProducts(int CategoryID, int ManufacturerID,
            bool? FeaturedProducts, decimal? PriceMin, decimal? PriceMax, string Keywords,
            bool SearchDescriptions, int PageSize, int PageIndex, out int TotalRecords, bool showHidden)


What does the "?" and the end of  bool and decimal do?  I've done a google search and without surprise the results were useless.

How is "bool FeaturedProducts" different from "bool? FeaturedProducts"?
14 anos atrás
The "?" means that the variable can hold the value type's normal range of values or null.

The variable "bool FeaturedProducts" can be either true or false.

The variable "bool? FeaturedProducts" can be true or false, or null.

More information about nullable types:
http://msdn.microsoft.com/en-us/library/1t3y8s4s%28VS.80%29.aspx
http://msdn.microsoft.com/en-us/library/2cf62fcy%28VS.80%29.aspx

.
14 anos atrás
as it says above, the ? is a nullable Type, Parameter, object or value
14 anos atrás
Thanks all.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.