public static FieldOptionViewModel ToFiledOptionModel(this FixedFiledDetails target, IAutoMapper mapper) { _mapper = mapper; var model = new FieldOptionViewModel(); if (target != null) { model.Id = target.Id; model.NameAr = target.NameAr; model.NameEn = target.NameEn; // model.Fileds = target.Fields != null ? target.Fields.Select(x => x.ToModel()).ToList() : null; } //Return Result return(model); }
public static FieldOptionViewModel ToModel(this FieldOption target, IAutoMapper mapper) { _mapper = mapper; //var model = _mapper.Map<FiledOptionViewModel>(target); var model = new FieldOptionViewModel(); // _mapper.Map<FormFiledViewModel>(target); model.Id = target.Id; model.CreateDate = target.CreateDate; model.FormFiledId = target.FormFiledId; model.IsActive = target.IsActive.Value; model.HasParent = target.HasParent; model.HasChild = target.HasChild; model.NameAr = target.NameAr; model.NameEn = target.NameEn; model.ParentId = target.ParentId; //Return Result return(model); }