Con solo CSS:
Cómo se hizo:
https://css-tricks.com/css-only-infinite-and-circular-image-slider/
Para empezar:
https://www.w3schools.com/react/default.asp
https://ibaslogic.com/react-tutorial-for-beginners/
https://leanpub.com/reactjsforthevisuallearner/read#leanpub-auto-chapter-1–what-is-this-all-about
Para seguir:
https://fullstackopen.com/es/about
Hooks:
https://css-tricks.com/react-hooks-the-deep-cuts/
https://www.freecodecamp.org/news/react-hooks-fundamentals/
Ebook:
En .NET por defecto se eliminan los registros relacionados en cascada. Para evitarlo antes de actualizar la base de datos tenemos que cambiar la migración:
constraints: table => { table.PrimaryKey("PK_ProfesionalesActividades", x => x.Id); table.ForeignKey( name: "FK_ProfesionalesActividades_Actividad_ActividadId", column: x => x.ActividadId, principalTable: "Actividad", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_ProfesionalesActividades_Profesionales_ProfesionalId", column: x => x.ProfesionalId, principalTable: "Profesionales", principalColumn: "Id", onDelete: ReferentialAction.Restrict); });
Para que por defecto sea así en todas las relaciones lo tenemos que poner en el contexto:
protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); foreach (var foreignKey in modelBuilder.Model.GetEntityTypes() .SelectMany(e => e.GetForeignKeys())) { foreignKey.DeleteBehavior = DeleteBehavior.Restrict; } }
Y si la cosa ya está hecha añadimos una migración a mano:
In the Package Manager Console, create a new, empty migration with the Add-Migration command, then fill in the Up method like this: migrationBuilder.DropForeignKey( name: "FK_ElementsPerStrip_Strips_StripId", table: "ElementsPerStrip"); migrationBuilder.AddForeignKey( name: "FK_ElementsPerStrip_Strips_StripId", table: "ElementsPerStrip", column: "StripId", principalTable: "Strips", principalColumn: "Id", onDelete: ReferentialAction.Restrict); For completeness, do the opposite in the Down method: migrationBuilder.DropForeignKey( name: "FK_ElementsPerStrip_Strips_StripId", table: "ElementsPerStrip"); migrationBuilder.AddForeignKey( name: "FK_ElementsPerStrip_Strips_StripId", table: "ElementsPerStrip", column: "StripId", principalTable: "Strips", principalColumn: "Id", onDelete: ReferentialAction.Cascade);
builder.Services.AddControllers().AddJsonOptions(x =>
x.JsonSerializerOptions.ReferenceHandler = ReferenceHandler.IgnoreCycles);
o
[JsonIgnore]
using Microsoft.EntityFrameworkCore; using Profesiones.Models; var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddControllers(); builder.Services.AddDbContext<Contexto>(options => options.UseSqlServer("Server=.\\SQLExpress;Database=Profesiones;Trusted_Connection=True;")); builder.Services.AddCors(options => { options.AddPolicy("AllowAll", builder => { builder .AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader(); }); }); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); var app = builder.Build(); // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { app.UseSwagger(); app.UseSwaggerUI(); } app.UseCors("AllowAll"); app.UseHttpsRedirection(); app.UseAuthorization(); app.MapControllers(); app.Run();
Con la web https://jsonplaceholder.typicode.com/guide/ vamos a mostrar un selector de usuarios (con sus nombres) cuando seleccionemos uno nos mostrarán todos los ‘todos’ que tiene, cada uno tendrá a su lado un botón de editar y otro de borrar. También tendremos un botón de añadir un ‘todo’ a ese usuario.