public async Task <HttpResponseMessage> GetById([FromUri] EduLevelBaseReq req) { var obj = await EduLevelBE.GetById(req); if (obj != null) { return(this.OkResult(obj)); } return(this.ErrorResult(new Error(EnumError.EduLevelNotExist))); }
public async Task <EduLevel> GetById(EduLevelBaseReq req) { var obj = await GetAsync(c => c.EduLevelCode == req.EduLevelCode); if (obj != null && obj.Any()) { return(obj.FirstOrDefault()); } return(null); }
public async Task <HttpResponseMessage> Delete(EduLevelBaseReq req) { var obj = await EduLevelBE.GetById(req); if (obj == null) { return(this.ErrorResult(new Error(EnumError.EduLevelNotExist))); } if (EduLevelBE.Delete(obj)) { return(this.OkResult()); } else { return(this.ErrorResult(new Error(EnumError.DeleteFailse))); } }