using Gestor.Model.Domain.Generic; using Gestor.Model.Domain.Seguros; using Gestor.Model.Helper; using Gestor.Model.Resources; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Runtime.CompilerServices; namespace Gestor.Model.Domain.Ferramentas { public class ResponsavelTarefa : DomainBase, IDomain { public long IdTarefa { get; set; } public Gestor.Model.Domain.Seguros.Usuario Usuario { get; set; } [JsonIgnore] public Func>> ValidationEvent { get { ResponsavelTarefa responsavelTarefa = this; return new Func>>(responsavelTarefa.Validate); } } public ResponsavelTarefa() { } public List> Validate() { List> keyValuePairs = ValidationHelper.AddValue(); if (this.Usuario == null || this.Usuario.Id == 0) { keyValuePairs.AddValue("Usuario", Messages.Obrigatorio, true); } if (this.IdTarefa == 0) { keyValuePairs.AddValue("IdTarefa", Messages.Obrigatorio, true); } return keyValuePairs; } } }