How can I use get to return a boolean from a C# class? -


i have following:

public class content { public string partitionkey { get; set; } public string rowkey { get; set; } ... } public class contentviewmodel { public string rowkey { get; set; } public content content { get; set; } public boolean userowkey { } } 

can tell me how can code in userowkey read , return true if content.rowkey first character "x".

how can use return boolean c# class?

you can not because classes have no return value, methods have (and properties - method special case of method).

now:

can tell me how can code in userowkey read , return true if content.rowkey first character "x"

but not "returning boolean class", know.

public bool userowkey { { return rowkey.startswith("x"); }} 

(untested, may have debug)

read only: not provide set. first char x: programming.


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -