Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- using System.Net;
- using System.Net.Http;
- using System.Security.Claims;
- using System.Web.Http;
- using System.Web.Http.Results;
- namespace DoctorWebService.Controllers
- {
- public class DataController : ApiController
- {
- [Authorize]
- [HttpGet]
- [Route("api/doctors")]
- public JsonResult<object> Get(string doctorCode)
- {
- if (doctorCode == "666")
- {
- var identity = (ClaimsIdentity)User.Identity;
- return Json<object>(new
- {
- stampCode = "666",
- email = "666_doctor@gmail.com",
- phone = "+370 640 000000",
- healthCareProvider = "Jonavos poliklinika"
- });
- }
- else
- {
- return Json<object>(new
- {
- notFound = 0
- });
- }
- }
- }
- }
- it returns:
- {
- "stampCode": "666",
- "email": "666_doctor@gmail.com",
- "phone": "+370 640 000000",
- "healthCareProvider": "Jonavos poliklinika"
- }
- [
- {
- "stampCode": "666",
- "email": "666_doctor@gmail.com",
- "phone": "+370 640 000000",
- "healthCareProvider": "Jonavos poliklinika"
- }
- ]
- [
- "stampCode: 666",
- "email: 666_doctor@gmail.com",
- "phone: +370 640 000000",
- "healthCareProvider: Jonavos poliklinika"
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement