public async Task <ActionResult <EntityEditFormModel> > GetEditSchema([FromServices] IAuthorizationService authorizationService, [FromServices] CrudResourcePointControllerFactory <TEntity, TCreateEntityDto, TEditEntityDto, TFilterableEntity, TKey> controllerFactory)
        {
            var updateResult = await authorizationService.AuthorizeAsync(User, typeof(TEntity), CrudOperations.Update);

            if (!updateResult.Succeeded)
            {
                return(Forbid());
            }

            var schemaProvider = controllerFactory.GetEntityFormSchemaProvider();
            var context        = new EntityEditSchemaProviderContext();

            var model = await schemaProvider.GetEditModelAsync(context);

            return(Ok(model));
        }
Exemple #2
0
 public Task <EntityEditFormModel> GetEditModelAsync(EntityEditSchemaProviderContext context)
 {
     return(Task.FromResult(FormModel));
 }