This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.ComponentModel; | |
using System.ComponentModel.DataAnnotations; | |
namespace Peliculas.Core.Dtos | |
{ | |
public class PeliculaDtoIn | |
{ | |
public string Encodedkey { get; set; } = Guid.NewGuid().ToString(); | |
[Required(ErrorMessage = "El título es obligatorio")] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class PeliculaMapeador | |
{ | |
public static PeliculaDto ToDto(this PeliculaEntidad entidad) => entidad is null ? null : new PeliculaDto | |
{ | |
Encodedkey = entidad.Encodedkey, | |
FechaDeRegistro = entidad.FechaDeRegistro, | |
Id = entidad.Id, | |
Sinopsis = entidad.Sinopsis, | |
Titulo = entidad.Titulo, | |
Trailer = entidad.Trailer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PeliculaEntidad | |
{ | |
//[JsonIgnore] | |
public int Id { get; set; } | |
[Required] | |
[MaxLength(50)] | |
public string Titulo { get; set; } | |
[Required] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Controlador de un CRUD de Tareas | |
public class HomeController : Controller | |
{ | |
/// Acceso a las reglas de negocio, provider, factory o service | |
private readonly IMediator _mediator; | |
/// Inyecccion del provider | |
public HomeController(IMediator mediator) | |
{ | |
_logger = logger; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
x:Class="HolaMundoMvvm.MainPage"> | |
<StackLayout Padding="30"> | |
<Label Text="Nombre:" /> | |
<!-- Se hace el enlace miedante la palabra clave Bindig a la propiedad del Persona.Nombre del ViewModel --> | |
<Entry Text="{Binding Persona.Nombre}" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace HolaMundoMvvm | |
{ | |
internal class PersonaModel | |
{ | |
public string Nombre { get; set; } | |
public int Edad { get; set; } | |
} | |
} |