Replies: 2 comments
-
Can you elaborate? What experience would you like to see? |
Beta Was this translation helpful? Give feedback.
-
@davidfowl .. Everything, First of all, why do we need multiple frameworks? REST is a stateless service and look very much like azure functions. Why do we ask developers to work in two different frameworks to do similar job? so, most importantly, I should be able to use TestServer and WebApplicationFactory to test functions end to end. I should be able to make serverless functions with [Route], [HttpMethod],[Authorize], [AllowAnonymouse] attributes, I should be able to create middleware, policies, rich model binder, automatic model validation, customize error handling middleware, custom action filter, have swagger, multiple parameters functions. Even SignalR and websockets can be done by giving them the exception of running forever. And we can introduce other non-http triggers also inside an asp.net core project as they look like hosted services and get them better design than those poorly designed static attributes they have now. and they apply attributes against parameters! (saving a nanosecond maybe?), but look at this readability also, I am trying for half an hour with breaks, tabs, indents, but no hope to make look like a code rather than a wiki paragraph! [FunctionName("ListDayAvailability")]
public async Task<IActionResult> ListDayAvailability([HttpTrigger(AuthorizationLevel.Function,
"get",
Route = "availability/{StoreId}/date/{Date}/service/{Service}")] ListDayAvailabilityRequest
request, CancellationToken ct = default) when it should be [HttpTrigger(POST)]
[Route("availability/{StoreId}/date/{Date}/service/{Service}")]
public async Task<IActionResult> ListDayAvailability([FromBody] ListDayAvailabilityRequest request, CancellationToken ct = default) See CosmosDb trigger [FunctionName(nameof(OrchestratorStarter))]
public async Task OrchestratorStarter([CosmosDBTrigger(
CosmosDbConstants.Database,
CosmosDbConstants.Container,
ConnectionStringSetting = "CosmosConnectionString",
LeaseCollectionName = "LeaseCollection",
LeaseCollectionPrefix = "LeaseCollectionPrefix",
CreateLeaseCollectionIfNotExists = true)] IReadOnlyList<Document> documents,
[DurableClient] IDurableOrchestrationClient client) When it should be //no need to function names
[CosmosDBTrigger(typeof(ICosmosDbTriggerSettings))]
public async Task OrchestratorStarter([FromTrigger] IReadOnlyList<Document> documents, IDurableOrchestrationClient client) |
Beta Was this translation helpful? Give feedback.
-
Azure Function Http trigger is terrible experience comparing to Web Api by Asp.Net Core .. We need a serverless version of Asp.Net Core.
Beta Was this translation helpful? Give feedback.
All reactions