|
|
-
Maciej Pakulski Answered 2 Years ago through Quizzes | 5 Points
It's because you need to add FlagsAttribute attribute to your enum. Adding that attribute will make you enum behave like bit fields.
[Flags]
enum Sizes : byte { None = 0, Small = 1, Medium = 2, Large = 4 }
class Program
...
|
-
Maciej Pakulski Answered 2 Years ago through Quizzes | 5 Points
I believe you can use Parse method. For instance, if you wan to parse a string that contains integer value, you can use:
Int32.Parse(svalue, NumberStyles.AllowThousands,NumberFormatInfo.InvariantInfo)
NumberFormatInfo.InvariantInfo uses comma ...
|
-
Maciej Pakulski Answered 2 Years ago through Quizzes | 5 Points
I believe it's because when the compiler parses the expression, it actually sees two strings:
**<%#Eval(** and **)%>**, and columnName is between those elements. That's why it says that the tag is not well formed.
But if you use single quotes , everyt...
|
-
Maciej Pakulski Answered 2 Years ago through Quizzes | 5 Points
It's because you defined your Program class in Math namespace, so the compiler sees the Math namespace created by you,
and it doesn't see Math class (because of the names conflict). Simply change the name of your namespace, and you'll get the proper re...
|
-
Maciej Pakulski Answered 2 Years ago through Quizzes | 5 Points
In .NET strings are immutable, so each time you append a string to a string, a new object is created. To overcome it,
we can use StringBuilder, which presents "mutable string of characters". Internally, it holds a buffer,
and each time you append a n...
|
-
Maciej Pakulski Answered 2 Years ago through Quizzes | 5 Points
Actually, I don't believe that using Random is good. OK, you use the constructor that takes only the id parameter, but it doesn't mean that vote should be random. In my opinion, a constructor should set a state of an object, but if we use a random value...
|
-
Maciej Pakulski Answered 2 Years ago through Quizzes | 5 Points
?? operator returns the operand on the left, if it's not null, otherwise it returns the operand on the right.
In your example, + operator has higher precedence than ?? operator, so the first operation is the sum.
To make it more clear, your example...
|
-
Maciej Pakulski Answered 2 Years ago through Quizzes | 5 Points
WCF ABC stands for:
- address - specifies where the service is.
- binding - specifies the details about the communication, like a protocol, encoding. There are some predefined bindings,
like BasicHttpBinding, WSHttpBinding, NetTcpBinding, etc.
...
|
-
Maciej Pakulski Answered 2 Years ago through Quizzes | 5 Points
I believe the second version of the sub/function is correct.
Operator ++ can be used in the ways:
- as a pre-increment operator
- as a post-increment operator
The second sub is a pre-increment equivalent. When you use the pre-increment operato...
|
-
Maciej Pakulski Answered 2 Years ago through Quizzes | 5 Points
I believe you should get: 6,4,2 and an exception will be thrown.
You are using IQueryable which has a property called Expression. That property returns an expression tree.
The expression tree is used to create a query appropriate for the current...
|