Hello,
This is Mrugesh from Bharti. We are developing an enterprise version of the application for our clients. What I have observed that my team is spending quite lots of time developing Get API for any entity. When I look at the code, it's quite repeated.
I tried System.Linq.Dynamic to create GET Data layer which permits an end-user to pass on expected columns.
See my intention to do so is,
Have a single GET API
Take columns names as parameters
I already have dynamic filters working for me. So the user can pass on filter parameters.
Ultimately, we won't be creating get variations.
What I have tried:
<pre>
IQueryable<Quickscrum.Models.EDMX.Employee> query = EDMXInstance.Context.Employees;
List<Quickscrum.Models.EDMX.Employee> employeeCollection = new List<Quickscrum.Models.EDMX.Employee>();
query = query.Where(FilterBuilder.GetDynamicQuery<Quickscrum.Models.EDMX.Employee>("Id, Name, Description, EmployeeDepartmentId, EmployeeDepartment.Id, EmployeeDepartment.Name, EmployeeDepartment.Description, EmployeeLocation.CityName"));
employeeCollection.AddRange(query.ToList());
return employeeCollection;