Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Flunt.Notifications;
- using Flunt.Validations;
- namespace MiniTodo.ViewModels
- {
- public class CreateTodoViewModel : Notifiable<Notification>
- {
- public string Title { get; set; }
- public Todo MapTo()
- {
- AddNotifications(new Contract<Notification>()
- .Requires()
- .IsNotNull(Title, "Informe o título da tarefa")
- .IsGreaterThan(Title, 5, "O título deve conter mais de 5 caracteres"));
- return new Todo(Guid.NewGuid(), Title, false);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement