public static async Task <ActionResult <IEnumerable <T> > > GetAll <T, TKey>(this Controller controller, IGetService <T, TKey> manager) where T : class where TKey : IComparable { var dtos = await manager.GetAll(); if (dtos == null) { return(controller.NotFound()); } return(controller.Ok(dtos)); }
public GetModule(IDataContext dataContext, IGetService getService) { Get("/api/v1/widgets/all/{Filter}/{Pagecount}/{Pagesize}", async parameters => { return(await getService.GetAll(dataContext, parameters)); }); Get("/api/v1/widgets/lastupdated/{Startdate}/{Enddate}/{Filter}/{Pagecount}/{Pagesize}", async parameters => { return(await getService.GetAllByLastUpdated(dataContext, parameters)); }); Get("/api/v1/widgets/createdOn/{Startdate}/{Enddate}/{Filter}/{Pagecount}/{Pagesize}", async parameters => { return(await getService.GetAllByCreatedOn(dataContext, parameters)); }); Get("/api/v1/widgets/{Id}/", async parameters => { return(await getService.GetOneById(dataContext, parameters)); }); }
public virtual IActionResult GetAll() { var result = Service.GetAll(); return(Ok(result)); }