public void Delete(Color entity) { var color = _colorDal.GetById(entity.Id); if (color == null) { throw new NullReferenceException("Silinecek renk bulunamadı!"); } _colorDal.Delete(color); }
public IResult Delete(Color entity) { var color = _colorDal.GetById(entity.Id); if (color == null) { return(new ErrorResult()); } _colorDal.Delete(color); return(new SuccessResult()); }
public IDataResult <Color> GetById(int Id) { if (_colorDal.GetAll(c => c.Id == Id).Count > 0) { return(new SuccessDataResult <Color>(_colorDal.GetById(c => c.Id == Id), Messages.RecordFound)); } return(new ErrorDataResult <Color>(Messages.IdInvalid)); }
public IDataResult <Color> GetById(int id) { var result = _colorDal.GetById(p => p.Id == id); if (result != null) { return(new SuccessDataResult <Color>(result, Messages.Listed)); } return(new ErrorDataResult <Color>(Messages.Error)); }
//silme public IResult Delete(Color entity) { //ilgili id ye göre silincek aracaı marka değişkeni içerisine ata var color = _colorDal.GetById(entity.ColorId); //boş ise if (color == null) { return(new ErrorDataResult <List <Car> >(Messages.ColorDeletedError)); } _colorDal.Delete(color); return(new SuccessResult(Messages.ColorDeleted)); }
public IBusinessDataResult <Color> GetById(int id) { var data = _colorDal.GetById(id); string message; bool isSuccess; if (data == null) { message = Messages.ColorNotFound; isSuccess = false; } else { message = Messages.ColorGetListByRegistered; isSuccess = true; } return(new BusinessDataResult <Color>(message, isSuccess, data)); }
public IDataResult <Color> GetById(int id) { return(new SuccesDataResult <Color>(_colorDal.GetById(p => p.Id == id))); }
public IDataResult <Color> GetById(int id) { return(new SuccessDataResult <Color>(_colorDal.GetById(c => c.Id == id), true, "Ürün Getirildi.")); }
public IDataResult <Color> GetById(int id) { return(new SuccessDataResult <Color>(_colorDal.GetById(p => p.ColorId == id), Messages.SuccessMessage)); }
public IDataResult <Color> GetByColorId(int id) { return(new SuccessDataResult <Color>(_colorDal.GetById(c => c.ColorId == id))); }
public List <Color> GetById(int id) { return(_colorDal.GetById(id)); }
public IDataResult <Color> GetById(int colorId) { return(new DataResult <Color>(_colorDal.GetById(c => c.Id == colorId), true, "Başarılı getirildi")); }
public IDataResult <Color> GetById(int id) { return(new SuccessDataResult <Color>(_colorDal.GetById(cl => cl.ColorId == id), BasicMessages.ProcessCompleted)); }
public Color GetColorNameByColorId(int colorId) { return(_colorDal.GetById(colorId)); }
public IDataResult <Color> Get(int id) { return(new SuccessDataResult <Color>(_colorDal.GetById(x => x.Id == id), Messages.ColorGet)); }
public IDataResult <Color> GetById(int id) { return(new SuccessDataResult <Color>(_colorDal.GetById(id), Messages.ColorsListedById)); }
public IDataResult <Color> GetById(int colorId) { return(new SuccessDataResult <Color>(_colorDal.GetById(x => x.Id == colorId))); }
public IDataResult <Colors> GetById(int id) { return(new SuccessDataResult <Colors>(_colorDal.GetById(c => c.ColorId == id), SuccessMessages.ColorListed)); }
public IDataResult <Color> GetById(int colorId) { return(new DataResult <Color>(_colorDal.GetById(c => c.Id == colorId), true)); }
public Color GetById(int colorId) { return(_colorDal.GetById(c => c.Id == colorId)); }
public Color GetById(int Id) { return(_colorDal.GetById(p => p.ColorId == Id)); }