public static Project ToProject(this ProjectTableEntity project) { return(new Project { ID = project.RowKey, ConsultantID = project.ConsultantID, ClientID = project.ClientID, Name = project.Name, Description = project.Description, StartDate = project.StartDate, EndDate = project.EndDate }); }
public static async Task <IActionResult> GetProjectByID( [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "project/{id}")] [Table("project", "PROJECT", "{id}", Connection = "AzureWebJobsStorage")] ProjectTableEntity project, HttpRequest req, ILogger log, string id) { log.LogInformation("Getting project by id."); if (project == null) { log.LogInformation($"Project {id} not found."); return(new NotFoundResult()); } return(new OkObjectResult(project.ToProject())); }