예제 #1
0
 public static Client ToClient(this ClientTableEntity client)
 {
     return(new Client
     {
         ID = client.RowKey,
         Name = client.Name,
         ContactName = client.ContactName,
         ContactEmailAddress = client.ContactEmailAddress,
         ContactPhoneNumber = client.ContactPhoneNumber,
         CompanyVAT = client.CompanyVAT,
         Address = client.Address
     });
 }
예제 #2
0
        public static async Task <IActionResult> GetClientByID(
            [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "client/{id}")]
            [Table("client", "CLIENT", "{id}", Connection = "AzureWebJobsStorage")]
            ClientTableEntity client,
            HttpRequest req, ILogger log, string id)
        {
            log.LogInformation("Getting client by id.");

            if (client == null)
            {
                log.LogInformation($"Client {id} not found.");
                return(new NotFoundResult());
            }

            return(new OkObjectResult(client.ToClient()));
        }