-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from automagic/GridRequestExtensions
Grid request extensions
- Loading branch information
Showing
9 changed files
with
2,755 additions
and
417 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2,279 changes: 2,279 additions & 0 deletions
2,279
KendoGridBinder.Examples/Dynamic Expressions.html
Large diffs are not rendered by default.
Oops, something went wrong.
348 changes: 177 additions & 171 deletions
348
KendoGridBinder.Examples/KendoGridBinder.Examples.csproj
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,39 @@ | ||
using System.Collections.Generic; | ||
|
||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Linq.Dynamic; | ||
|
||
namespace KendoGridBinder.Examples.Models | ||
{ | ||
public class EmployeeRepository : IEmployeeRepository | ||
{ | ||
readonly KendoDataContext _db = new KendoDataContext(); | ||
|
||
public IEnumerable<Employee> GetAll() | ||
{ | ||
return _db.Employees; | ||
} | ||
} | ||
|
||
{ | ||
public class EmployeeRepository : IEmployeeRepository | ||
{ | ||
private readonly KendoDataContext _db = new KendoDataContext(); | ||
|
||
public IEnumerable<Employee> GetAll() | ||
{ | ||
return _db.Employees; | ||
} | ||
|
||
public IEnumerable<Employee> GetPaged(int skip, int take, string sort, string filter) | ||
{ | ||
// using pattern to demonstrate scenario where IQueryable is evaluated in a different context / scope | ||
using(var db = new KendoDataContext()){ | ||
return db.Employees.Where(filter).OrderBy(sort).Skip(skip).Take(take).ToList(); | ||
} | ||
} | ||
|
||
public int GetCount(string filter) | ||
{ | ||
using (var db = new KendoDataContext()) | ||
{ | ||
return db.Employees.Where(filter).Count(); | ||
} | ||
} | ||
} | ||
|
||
public interface IEmployeeRepository | ||
{ | ||
IEnumerable<Employee> GetAll(); | ||
IEnumerable<Employee> GetAll(); | ||
IEnumerable<Employee> GetPaged(int skip, int take, string sort, string filter); | ||
int GetCount(string filter); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,80 +1,80 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
For more information on how to configure your ASP.NET application, please visit | ||
http://go.microsoft.com/fwlink/?LinkId=152368 | ||
--> | ||
<configuration> | ||
<configSections> | ||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> | ||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> | ||
</configSections> | ||
<connectionStrings> | ||
<add name="KendoDataContext" connectionString="Data Source=|DataDirectory|Employees.sdf" providerName="System.Data.SqlServerCe.4.0" /> | ||
</connectionStrings> | ||
<appSettings> | ||
<add key="webpages:Version" value="1.0.0.0" /> | ||
<add key="ClientValidationEnabled" value="true" /> | ||
<add key="UnobtrusiveJavaScriptEnabled" value="true" /> | ||
</appSettings> | ||
<system.web> | ||
<compilation debug="true" targetFramework="4.0"> | ||
<assemblies> | ||
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> | ||
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> | ||
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> | ||
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> | ||
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> | ||
</assemblies> | ||
</compilation> | ||
<authentication mode="Forms"> | ||
<forms loginUrl="~/Account/LogOn" timeout="2880" /> | ||
</authentication> | ||
<membership> | ||
<providers> | ||
<clear /> | ||
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" /> | ||
</providers> | ||
</membership> | ||
<profile> | ||
<providers> | ||
<clear /> | ||
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" /> | ||
</providers> | ||
</profile> | ||
<roleManager enabled="false"> | ||
<providers> | ||
<clear /> | ||
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" /> | ||
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" /> | ||
</providers> | ||
</roleManager> | ||
<pages> | ||
<namespaces> | ||
<add namespace="System.Web.Helpers" /> | ||
<add namespace="System.Web.Mvc" /> | ||
<add namespace="System.Web.Mvc.Ajax" /> | ||
<add namespace="System.Web.Mvc.Html" /> | ||
<add namespace="System.Web.Routing" /> | ||
<add namespace="System.Web.WebPages" /> | ||
</namespaces> | ||
</pages> | ||
</system.web> | ||
<system.webServer> | ||
<validation validateIntegratedModeConfiguration="false" /> | ||
<modules runAllManagedModulesForAllRequests="true" /> | ||
</system.webServer> | ||
<runtime> | ||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
<dependentAssembly> | ||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /> | ||
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" /> | ||
</dependentAssembly> | ||
<dependentAssembly> | ||
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" /> | ||
<bindingRedirect oldVersion="0.0.0.0-4.3.1.0" newVersion="4.3.1.0" /> | ||
</dependentAssembly> | ||
</assemblyBinding> | ||
</runtime> | ||
<system.data> | ||
</system.data> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
For more information on how to configure your ASP.NET application, please visit | ||
http://go.microsoft.com/fwlink/?LinkId=152368 | ||
--> | ||
<configuration> | ||
<configSections> | ||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> | ||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> | ||
</configSections> | ||
<connectionStrings> | ||
<add name="KendoDataContext" connectionString="Data Source=|DataDirectory|Employees.sdf" providerName="System.Data.SqlServerCe.4.0" /> | ||
</connectionStrings> | ||
<appSettings> | ||
<add key="webpages:Version" value="1.0.0.0" /> | ||
<add key="ClientValidationEnabled" value="true" /> | ||
<add key="UnobtrusiveJavaScriptEnabled" value="true" /> | ||
</appSettings> | ||
<system.web> | ||
<compilation debug="true" targetFramework="4.0"> | ||
<assemblies> | ||
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> | ||
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> | ||
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> | ||
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> | ||
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> | ||
</assemblies> | ||
</compilation> | ||
<authentication mode="Forms"> | ||
<forms loginUrl="~/Account/LogOn" timeout="2880" /> | ||
</authentication> | ||
<membership> | ||
<providers> | ||
<clear /> | ||
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" /> | ||
</providers> | ||
</membership> | ||
<profile> | ||
<providers> | ||
<clear /> | ||
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" /> | ||
</providers> | ||
</profile> | ||
<roleManager enabled="false"> | ||
<providers> | ||
<clear /> | ||
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" /> | ||
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" /> | ||
</providers> | ||
</roleManager> | ||
<pages> | ||
<namespaces> | ||
<add namespace="System.Web.Helpers" /> | ||
<add namespace="System.Web.Mvc" /> | ||
<add namespace="System.Web.Mvc.Ajax" /> | ||
<add namespace="System.Web.Mvc.Html" /> | ||
<add namespace="System.Web.Routing" /> | ||
<add namespace="System.Web.WebPages" /> | ||
</namespaces> | ||
</pages> | ||
</system.web> | ||
<system.webServer> | ||
<validation validateIntegratedModeConfiguration="false" /> | ||
<modules runAllManagedModulesForAllRequests="true" /> | ||
</system.webServer> | ||
<runtime> | ||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
<dependentAssembly> | ||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /> | ||
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" /> | ||
</dependentAssembly> | ||
<dependentAssembly> | ||
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" /> | ||
<bindingRedirect oldVersion="0.0.0.0-4.3.1.0" newVersion="4.3.1.0" /> | ||
</dependentAssembly> | ||
</assemblyBinding> | ||
</runtime> | ||
<system.data> | ||
</system.data> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="EntityFramework" version="4.3.1" /> | ||
<package id="jQuery" version="1.7.1" /> | ||
<package id="jQuery.Validation" version="1.9" /> | ||
<package id="KendoUIWeb" version="2012.1.322" /> | ||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" /> | ||
<package id="MiniProfiler" version="2.0.1" /> | ||
<package id="MiniProfiler.EF" version="2.0.2" /> | ||
<package id="MiniProfiler.MVC3" version="2.0.1" /> | ||
<package id="WebActivator" version="1.5" /> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="DynamicQuery" version="1.0" targetFramework="net40" /> | ||
<package id="EntityFramework" version="4.3.1" /> | ||
<package id="jQuery" version="1.7.1" /> | ||
<package id="jQuery.Validation" version="1.9" /> | ||
<package id="KendoUIWeb" version="2012.1.322" /> | ||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" /> | ||
<package id="MiniProfiler" version="2.0.1" /> | ||
<package id="MiniProfiler.EF" version="2.0.2" /> | ||
<package id="MiniProfiler.MVC3" version="2.0.1" /> | ||
<package id="WebActivator" version="1.5" /> | ||
</packages> |
Oops, something went wrong.