public async Task <IActionResult> OnPost()
        {
            if (!ModelState.IsValid)
            {
                CargarMaterial(MaterialId);
                return(Page());
            }

            Color.MaterialId = MaterialId;
            var result = _colorData.Add(Color);
            await _colorData.Commit();

            TempData["Message"] = $"Se ha creado el color: {result.Nombre}";

            return(RedirectToPage("/Materiales/Colores/Index", new { materialId = MaterialId }));
        }
Exemple #2
0
 public static IColorData Add(this IColorData value, IColorData other)
 {
     return(value.Add(other));
 }