This file contains hidden or 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
| Account account = new Account(); | |
| _contact.FirstName = "Jim"; | |
| _context.AddRelatedObject(account, new Relationship("relationship_name"), contact); | |
| _context.AddObject(account); | |
| _context.UpdateObject(contact); | |
| _context.SaveChanges(); |
This file contains hidden or 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
| > curl http://localhost:51307/api/tasks | |
| [ | |
| {"Id":1,"Subject":"Test","Description":"Some interestingish text"}, | |
| {"Id":2,"Subject":"Test 2","Description":"Some more text"} | |
| ] |
This file contains hidden or 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
| using System.Collections.Generic; | |
| using System.Web.Http; | |
| using System.Net.Http; | |
| using TaskManager.Models; | |
| using System.Linq; | |
| using System.Net; | |
| using System; | |
| namespace TaskManager.Controllers | |
| { |
This file contains hidden or 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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Web.Http; | |
| namespace TaskManager | |
| { | |
| public static class WebApiConfig | |
| { | |
| public static void Register(HttpConfiguration config) |
This file contains hidden or 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
| > curl http://localhost:51307/api/tasks -v | |
| > GET /api/tasks HTTP/1.1 | |
| > User-Agent: curl/7.23.1 (x86_64-pc-win32) libcurl/7.23.1 OpenSSL/0.9.8r zlib/1.2.5 | |
| > Host: localhost:51307 | |
| > Accept: */* | |
| > | |
| < HTTP/1.1 200 OK | |
| < Cache-Control: no-cache | |
| < Pragma: no-cache |
This file contains hidden or 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
| > curl http://localhost:51307/api/tasks/1 -i | |
| HTTP/1.1 200 OK | |
| Cache-Control: no-cache | |
| Pragma: no-cache | |
| Content-Type: application/json; charset=utf-8 | |
| Expires: -1 | |
| Server: Microsoft-IIS/8.0 | |
| X-AspNet-Version: 4.0.30319 | |
| X-SourceFiles: =?UTF-8?B?RDpcU09VUkNFXHBsdXJhbHNpZ2h0XG12YzRcVGFza01hbmFnZXJcVGFza01hbmFnZXJcYXBpXHRhc2tzXDE=?= |
This file contains hidden or 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
| > curl http://localhost:51307/api/tasks -H "Accept: application/xml" | |
| <ArrayOfTask xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TaskMana | |
| ger.Models"><Task><Description>Some interestingish text</Description><Id>1</Id><Subject>Test</Subject></Task><Task><Desc | |
| ription>Some more text</Description><Id>2</Id><Subject>Test 2</Subject></Task></ArrayOfTask> |
This file contains hidden or 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
| > curl http://localhost:51307/api/tasks/2 -X DELETE -v | |
| > DELETE /api/tasks/2 HTTP/1.1 | |
| > User-Agent: curl/7.23.1 (x86_64-pc-win32) libcurl/7.23.1 OpenSSL/0.9.8r zlib/1.2.5 | |
| > Host: localhost:51307 | |
| > Accept: */* | |
| > | |
| < HTTP/1.1 200 OK | |
| < Cache-Control: no-cache | |
| < Pragma: no-cache |
This file contains hidden or 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
| > curl http://localhost:51307/api/tasks -X POST -d "id=2&subject=test&description=blah" -v | |
| > POST /api/tasks HTTP/1.1 | |
| > User-Agent: curl/7.23.1 (x86_64-pc-win32) libcurl/7.23.1 OpenSSL/0.9.8r zlib/1.2.5 | |
| > Host: localhost:51307 | |
| > Accept: */* | |
| > Content-Length: 34 | |
| > Content-Type: application/x-www-form-urlencoded | |
| > | |
| * upload completely sent off: 34 out of 34 bytes |
This file contains hidden or 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
| CreateEntityRequest createrequest = new CreateEntityRequest | |
| { | |
| //Define the entity | |
| Entity = new EntityMetadata | |
| { | |
| SchemaName = _customEntityName, | |
| DisplayName = new Label("Bank Account", 1033), | |
| DisplayCollectionName = new Label("Bank Accounts", 1033), | |
| Description = new Label("An entity to store information about customer bank accounts", 1033), |