Ejemplo n.º 1
0
        public static SearchResultModel FromDto(SearchResultDto dto)
        {
            if (dto == null)
            {
                return(null);
            }

            return(new SearchResultModel
            {
                citizens = dto.Citizens?.Select(a => CitizenModel.FromDto(a)).ToArray(),
                is_successed = dto.IsSuccessed,
                message = dto.Message,
                error = dto.Error
            });
        }
Ejemplo n.º 2
0
        public static GetResultModel FromDto(GetResultDto dto)
        {
            if (dto == null)
            {
                return(null);
            }

            return(new GetResultModel
            {
                citizen = CitizenModel.FromDto(dto.Citizen),
                is_successed = dto.IsSuccessed,
                message = dto.Message,
                error = dto.Error
            });
        }
Ejemplo n.º 3
0
        public static CitizenDto ToDto(CitizenModel model)
        {
            if (model == null)
            {
                return(null);
            }

            return(new CitizenDto
            {
                Id = model.id,
                Cdate = model.cdate,
                Udate = model.udate,
                FirstName = model.first_name,
                LastName = model.last_name,
                Patronymic = model.patronymic,
                Inn = model.inn,
                Snils = model.snils,
                BirthDate = model.birth_date,
                DeathDate = model.death_date
            });
        }