Where is the task for 18.1 so I can track the progress of the Razor/API scaffolding?
Hi @bbakermmc.
You can find information about CRUD API controller scaffolding in Visual Studio here:
DevExtreme v18.1 Preview - CRUD API Controller Scaffolding in Visual Studio
As for CRUD Razor view scaffolding, we have no public place where you can track progress. We will update the roadmap page on js.devexpress.com when we have any results on it. Stay tuned!
Thank you for your interest in our product! Your feedback is greatly appreciated.
Hi @bbakermmc
We have progress on the view scaffolding feature! You can find all information about its early preview here:
DevExtreme v18.1 Preview - CRUD Razor View Scaffolding in Visual Studio
Thanks.
Doesn't seem to work if the context isn't in the project you're making the scaffold for.
Would there be an option to override the templates. IE we use AspNetBoilerplate which implements IRepository
So ideally we would not want to use the context directly, I was going to see what the output code was, we can probably just do some simple replacements.
EX:
```c#
private readonly IRepository
[DontWrapResult]
[AbpMvcAuthorize(AppPermissions.QA)]
[DevExtremeExceptionFilter]
public virtual ActionResult DevExpress_QuestionsRead(DataSourceLoadOptions loadOptions)
{
var result =
DataSourceLoader.Load(
_questionRepository.GetAll().Include(x => x.QuestionLevel).Include(x => x.QuestionType)
.Include(x => x.QuestionFlatTableRule), loadOptions);
var resultJson = JsonConvert.SerializeObject(result, new JsonSerializerSettings
{
ContractResolver = new DefaultContractResolver()
});
return Content(resultJson, "application/json");
}
[DontWrapResult]
[AbpMvcAuthorize(AppPermissions.QA_Delete)]
[DevExtremeExceptionFilter]
public async Task DevExpress_QuestionDestroy(int key)
{
await _answerRepository.GetAll().Where(x => x.QuestionId == key).DeleteAsync();
await _questionRepository.DeleteAsync(key);
}
[DontWrapResult]
[AbpMvcAuthorize(AppPermissions.QA_Create)]
[DevExtremeExceptionFilter]
public async Task<IActionResult> DevExpress_QuestionCreate(string values)
{
var data = new Question();
JsonConvert.PopulateObject(values, data);
if (!TryValidateModel(data))
return BadRequest(ModelState.GetFullErrorMessage());
await _questionRepository.InsertAsync(data);
return Ok();
}
[DontWrapResult]
[AbpMvcAuthorize(AppPermissions.QA_Edit)]
[DevExtremeExceptionFilter]
public async Task<IActionResult> DevExpress_QuestionEdit(int key, string values)
{
var data = _questionRepository.Get(key);
JsonConvert.PopulateObject(values, data);
if (!TryValidateModel(data))
return BadRequest(ModelState.GetFullErrorMessage());
await _questionRepository.UpdateAsync(data);
return Ok();
}
```
Thank you for your feedback!
Doesn't seem to work if the context isn't in the project you're making the scaffold for.
It is a good point! We are going to make the context optional for view scaffolding in the next feature update.
Would there be an option to override the templates
As far as we understand, you want to configure additional widget options, do you?
I dont want to "configure" the widget options per-say. I want to be able to generate the required CRUD methods w/out having to use a context. .Net Core doesnt support T4 and the rosyln code generation is complex for something this basic. My list post provided examples of the methods I currently uses with my Repositorys.
Thank you for the clarification. Now we understand your suggestion. Our current goal regarding this feature is to support CRUD API/View scaffolding based on the Entity Framework and Entity Framework Core. Thanks again for your feedback! We will keep it in mind during future release planning.
@bbakermmc
Thank you for your valuable feedback. This feature is now available in v18.1. I'm closing this issue. In the case of bugs or questions, feel free to create new separate tickets in our Support Center.
We are moving forward and already working on our roadmap for v18.2 and v19.1. We invite you to share your thoughts on future scaffolding wizard improvements in our next releases here: DevExtreme v18.2 Preview - Visual Studio Scaffolding Improvements. Don't forget to add this ticket to your Favorites, so you can follow our progress.
Thank you for your assistance in making our products better!
Most helpful comment
Thanks.
Doesn't seem to work if the context isn't in the project you're making the scaffold for.
Would there be an option to override the templates. IE we use AspNetBoilerplate which implements IRepository.
So ideally we would not want to use the context directly, I was going to see what the output code was, we can probably just do some simple replacements.
EX: _questionRepository;
```c#
private readonly IRepository
[DontWrapResult]
[AbpMvcAuthorize(AppPermissions.QA)]
[DevExtremeExceptionFilter]
public virtual ActionResult DevExpress_QuestionsRead(DataSourceLoadOptions loadOptions)
{
var result =
DataSourceLoader.Load(
_questionRepository.GetAll().Include(x => x.QuestionLevel).Include(x => x.QuestionType)
.Include(x => x.QuestionFlatTableRule), loadOptions);
var resultJson = JsonConvert.SerializeObject(result, new JsonSerializerSettings
{
ContractResolver = new DefaultContractResolver()
});
return Content(resultJson, "application/json");
}
[DontWrapResult]
[AbpMvcAuthorize(AppPermissions.QA_Delete)]
[DevExtremeExceptionFilter]
public async Task DevExpress_QuestionDestroy(int key)
{
await _answerRepository.GetAll().Where(x => x.QuestionId == key).DeleteAsync();
await _questionRepository.DeleteAsync(key);
}
```