public ActorListResponse FindActor(string findActor) { Dictionary <string, string[]> errors = new Dictionary <string, string[]>(); List <ActorReturnDto> actors = new List <ActorReturnDto>(); var actorss = _context.Actors; foreach (var e in actorss) { if (e.ActorName.Contains(findActor.ToUpper()) || e.ActorSurname.Contains(findActor.ToUpper())) { actors.Add(_mapper.Map <Actor, ActorReturnDto>(e)); } } if (actors == null) { errors.Add("Actor", new[] { "Nie ma takich aktorów" }); return(new ActorListResponse(errors)); } ActorListReturnDto result = new ActorListReturnDto { ActorList = actors }; return(new ActorListResponse(result)); }
public ActorListResponse(ActorListReturnDto actorList) : this(true, new Dictionary <string, string[]>(), actorList) { }
private ActorListResponse(bool success, Dictionary <string, string[]> message, ActorListReturnDto actorList) : base(success, message) { ActorList = actorList; }