Created
March 24, 2015 20:50
-
-
Save csharpfritz/f6008fff20509f744a58 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ContactsController : ApiController | |
{ | |
[HttpGet] | |
public IEnumerable<Contact> GetAll() | |
{ | |
return new Contact[] { | |
new Contact { Id = 1, EmailAddress = "[email protected]", Name = "Barney Poland"}, | |
new Contact { Id = 2, EmailAddress = "[email protected]", Name = "Lacy Barrera"}, | |
new Contact { Id = 3, EmailAddress = "[email protected]", Name = "Lora Riggs"} | |
}; | |
} | |
} | |
public class ValuesController : ApiController | |
{ | |
public IEnumerable<string> Get() | |
{ | |
return new string[] { "value1", "value2" }; | |
} | |
public string GetById(int id) | |
{ | |
return "value"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment