Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Color
- {
- private static string[] _colors = {"Red", "Green", "Blue"};
- public static int Index { get; set; }
- public static string GetNextColor()
- {
- var retVal = _colors[Index];
- Index++;
- return retVal;
- }
- }
- [HttpGet]
- public string TestColor()
- {
- Color.Index = 0;
- return string.Format("First color: {0} Second color: {1} Third color: {2}", Color.GetNextColor(), Color.GetNextColor(), Color.GetNextColor());
- }
- <string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">
- First color: Red Second color: Green Third color: Blue
- </string>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement