-
-
Save rsleggett/3d8d6e168f27bb548a15 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
[PluginController("ClientAdministrationSection")] | |
public class ClientApiController : UmbracoAuthorizedJsonController | |
{ | |
public ClientApiController() | |
{ | |
int i = 0; // for testing only | |
} | |
public IEnumerable<Client> Getall() | |
{ | |
var repository = new ClientRepository(); | |
return repository.GetAll(); | |
} | |
public Client GetById(int id) | |
{ | |
var repository = new ClientRepository(); | |
return repository.GetById(id); | |
} | |
public void PostSave(Client client) | |
{ | |
var repository = new ClientRepository(); | |
if (client.Id != 0) | |
{ | |
repository.Update(client); | |
} | |
else | |
{ | |
repository.Add(client); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment