public StarSignDto GetByCode(int code) { StarSignDto dto = new StarSignDto(); var entity = repository.Collect(p => p.Code == code).FirstOrDefault(); if (entity != null) { return(dto.ToObject(entity)); } return(null); }
public static void FillStarSign(ComboBox cmb) { StarSignViewModel viewModel = new StarSignViewModel(); cmb.DisplayMember = "StarSignName"; cmb.ValueMember = "StarSignId"; var entities = viewModel.GetAllStarSigns().ToList(); StarSignDto dto = new StarSignDto() { Code = 0, StarSignId = 0, StarSignName = "തിരഞ്ഞെടുക്കുക" }; entities.Add(dto); cmb.DataSource = entities; cmb.SelectedValue = 0; }
public IEnumerable <StarSignDto> GetAllStarSigns() { StarSignDto dto = new StarSignDto(); return(dto.ToObjects(repository.GetAll())); }