public IDataResult <Context> GetById(int id) { Context result; try { result = _contextDal.Get(c => c.Id == id); } catch (Exception) { return(new ErrorDataResult <Context>("Cannot get content")); } return(new SuccessDataResult <Context>(result)); }
public IDataResult <Context> GetByContext(int id) { return(new SuccessDataResult <Context>(_contextDal.Get(context => context.ContextId == id))); }