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));
        }
示例#2
0
 public IDataResult <Context> GetByContext(int id)
 {
     return(new SuccessDataResult <Context>(_contextDal.Get(context => context.ContextId == id)));
 }