public int UpdateDarabandi(DarbandiDTO data) { Darbandi darb = DarbandiRequestFormatter.ConvertRespondentInfoFromDTO(data); var response = _unitOfWork.DarbandiRepository.Update(darb); _unitOfWork.Save(); return(response); }
public DarbandiDTO InsertDarabandi(DarbandiDTO data) { Darbandi darbandi = DarbandiRequestFormatter.ConvertRespondentInfoFromDTO(data); _darbandi.DarbandiDate = darbandi.DarbandiDate; _darbandi.DarbandiDesgId = darbandi.DarbandiDesgId; _darbandi.DarbandiId = darbandi.DarbandiId; _darbandi.DarbandiNumber = darbandi.DarbandiNumber; _darbandi.DarbandiOfficeId = darbandi.DarbandiOfficeId; _darbandi.DarbandiRemarks = darbandi.DarbandiRemarks; _darbandi.DarbandiType = darbandi.DarbandiType; return(DarbandiRequestFormatter.ConvertRespondentInfoToDTO(_unitOfWork.DarbandiRepository.Create(darbandi))); }
public static DarbandiDTO ConvertRespondentInfoToDTO(Darbandi darbandi) { Mapper.CreateMap <Darbandi, DarbandiDTO>().ConvertUsing( m => { return(new DarbandiDTO { DarbandiDate = m.DarbandiDate, DarbandiDesgId = m.DarbandiDesgId, DarbandiId = m.DarbandiId, DarbandiNumber = m.DarbandiNumber, DarbandiOfficeId = m.DarbandiOfficeId, DarbandiRemarks = m.DarbandiRemarks, DarbandiType = m.DarbandiType }); }); return(Mapper.Map <Darbandi, DarbandiDTO>(darbandi)); }
public DarbandiService(IUnitOfWork unitOfWork = null) { _unitOfWork = unitOfWork ?? new UnitOfWork(); _darbandi = new Darbandi(); }