LINQ: throwing exception when Null is returned to a string? Attribute on a class? -


I have a linq query that I am selecting in a string, of course a string can be zero!

So if there is any way, I can throw an exception in my Linux query, if I find a blank address?

Can I decorate my class with an attribute which will not allow it to be nose?

I would like to wrap my linq query in a try. And as soon as a tap is detected, it will enter the hold .. and I can handle it.

Any help really appreciated

Edit

This is my Linux query, it is very easy now. I'm going to expand it .. but it shows you

  var local text = select new item from item {item = t.name}   

The item is originally set to t.name, t.name is a string, it can be empty / tap, it is completely legal because it can have a string and string faucet .

So if this returns the tap, then I have to throw an exception.

Actually it is easy to be able to throw a exc. The emission is empty or empty.

I had to remember some attributes which can be set at the top of the properties, which are called "do not accept tap" etc. ??

Edit

I believe that I got it ..

does not allow faucet or wire, so I think it throws an exception, I have used it MVC but not sure I can use it with a standard class?

Does anyone confirm this?

The string like a string is not particularly exceptional, you can do something like this:

  var items = myStrings.Where (s =>! String.IsallApply (s)) (S => New item (s));   

UPDATE

If you are reading this data from an XML file, you should see an XML file instead of elements or Throw an exception to the attributes which are not included in the strings.

Comments