JCTools.GenericCrud
1.0.5
See the version list below for details.
dotnet add package JCTools.GenericCrud --version 1.0.5
NuGet\Install-Package JCTools.GenericCrud -Version 1.0.5
<PackageReference Include="JCTools.GenericCrud" Version="1.0.5" />
paket add JCTools.GenericCrud --version 1.0.5
#r "nuget: JCTools.GenericCrud, 1.0.5"
// Install JCTools.GenericCrud as a Cake Addin #addin nuget:?package=JCTools.GenericCrud&version=1.0.5 // Install JCTools.GenericCrud as a Cake Tool #tool nuget:?package=JCTools.GenericCrud&version=1.0.5
JCTools.GenericCrud
Simplification of the Create, Read, Update and Delete pages of the application models.
Overview
All application required multiple pages for edited the base models. This pages generally are equals to each other.
This package allows reduce this task at minimum of actions.
You only require create and configure your models, and this package create the necessary controllers, views and actions for the Create, Read, Update and Delete actions.
Usage
- Add the package to your application
Install-Package JCTools.GenericCrud -Version 1.0.2
Or
dotnet add package JCTools.GenericCrud --version 1.0.2
- Add the next lines in the method ConfigureServices of your Startup class
services.ConfigureGenericCrud(o =>
{
o.UseModals = true;
o.ContextCreator = () => new Test.Data.Context(); // method that will create an database context instance
o.Models.Add(typeof(Models.Country)); // add the model type to manage with the package
});
- Add the next line in the UseMvc middleware call, this in the method Configure of your Startup class
routes.MapCrudRoutes();
Your code should see similar to the next code
app.UseMvc(routes =>
{
routes.MapCrudRoutes(); // add this line
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
- Run to app and access at the url http://localhost:5000/[ModelName], sample: http://localhost:5000/Country. In the browser you should see a similar page to :
Custom controllers
If your desired personalize your controllers, add additional actions or override the default actions, then
- Not add the model to manage in the step 3 of the last section
- Create a new controller the inherits from JCTools.GenericCrud.Controllers.GenericController<TDbContext, TModel, TKey>. sample
using System;
using JCTools.GenericCrud.Controllers;
using JCTools.GenericCrud.Services;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Logging;
namespace Test.Controllers
{
public class MovieController : GenericController<Data.Context, Models.Movie, int>
{
public MovieController(IServiceProvider serviceProvider)
: base(serviceProvider)
{
Settings.UseModals = false;
}
}
}
- Run to app and access at the url http://localhost:5000/Movie,
License
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 is compatible. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
-
.NETCoreApp 2.0
- Microsoft.AspNetCore.Mvc (>= 2.0.2)
- Microsoft.AspNetCore.Mvc.Razor (>= 2.0.2)
- Microsoft.AspNetCore.Mvc.ViewFeatures (>= 2.0.2)
- Microsoft.DotNet.PlatformAbstractions (>= 2.0.4)
- Microsoft.EntityFrameworkCore (>= 2.0.1)
- Microsoft.Extensions.FileProviders.Embedded (>= 2.0.0)
- Microsoft.Extensions.Localization (>= 2.0.1)
- System.Linq.Dynamic.Core (>= 1.0.8.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.2.2 | 347 | 12/8/2022 |
2.2.1 | 406 | 3/14/2021 |
2.2.0 | 352 | 2/2/2021 |
2.1.0 | 375 | 1/19/2021 |
2.1.0-beta1 | 306 | 1/10/2021 |
2.0.0 | 389 | 1/9/2021 |
2.0.0-beta4 | 293 | 1/6/2021 |
2.0.0-beta2 | 229 | 1/4/2021 |
2.0.0-beta1 | 295 | 12/27/2020 |
1.0.5 | 1,018 | 5/11/2018 |
1.0.4.2 | 1,066 | 5/8/2018 |
1.0.4.1 | 1,055 | 5/8/2018 |
1.0.4 | 1,014 | 5/7/2018 |
1.0.3 | 1,033 | 5/6/2018 |
1.0.2 | 1,037 | 4/19/2018 |
1.0.1 | 1,059 | 4/13/2018 |
1.0.0 | 1,071 | 3/19/2018 |