Example #1
0
 public Classification(int id, int position, ShortStory shortStory, Challenge challenge)
 {
     EntityName      = "Classification";
     this.Id         = id;
     this.Position   = position;
     this.ShortStory = shortStory;
     this.Challenge  = challenge;
 }
Example #2
0
        public override ActionResponseDTO Validate()
        {
            ActionResponseWrapper actionResponse = new ActionResponseWrapper(EntityName);

            if (Position <= 0)
            {
                actionResponse.AddError("'Posição' é campo obrigatório de uma classificação.");
            }

            if (ShortStory == null)
            {
                actionResponse.AddError("Toda classificação tem que ter um Conto atrelado a ela.");
            }
            else
            {
                actionResponse.IncorporateActionResponse(ShortStory.Validate());
            }

            return(actionResponse.Value);
        }