public async Task <IEnumerable <SpecItem> > GetAllSpecItems() { try { var repo = new RepoBase <SpecItem>("SpecItems"); return(await repo.FindALL()); } catch (Exception ex) { throw ex; } }
public async Task<IEnumerable<WarrentyType>> GetAllWarrentyTypes() { try { var repo = new RepoBase<WarrentyType>("WarrentyType"); return await repo.FindALL(); } catch (Exception ex) { throw ex; } }
public async Task <HttpResponseMessage> SearchCatelogItems() { RepoBase <CateglogProducts> repo; try { repo = new RepoBase <CateglogProducts>("CateglogProducts"); string username = RequestContext.Principal.Identity.Name; string clientAddress = HttpContext.Current.Request.UserHostAddress; return(Request.CreateResponse(HttpStatusCode.OK, await repo.FindALL())); } catch (Exception ex) { LogHelper.WriteLog(HttpContext.Current.Request, ex, RequestContext.Principal.Identity.Name); return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex)); } }
public async Task <HttpResponseMessage> GetAllBrands() { RepoBase <Brand> specmaster; try { specmaster = new RepoBase <Brand>("Brands"); string clientAddress = HttpContext.Current.Request.UserHostAddress; return(Request.CreateResponse <IEnumerable <Brand> >(HttpStatusCode.OK, await specmaster.FindALL())); } catch (Exception ex) { specmaster = null; LogHelper.WriteLog(HttpContext.Current.Request, ex, RequestContext.Principal.Identity.Name); return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex)); } }