Code Monkey home page Code Monkey logo

dlinq-helpers's People

Contributors

akorchev avatar bsatrom avatar burkeholland avatar corydeppen avatar profsoft avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dlinq-helpers's Issues

Filtering on data with NULL string values.

Using a kendo ui grid control and ToDataSourceResult on the server side. Should DynamicLinq handle NULL string values when filtering database data. It current throws and exception.

Making filtering not case sensitive

This helper fulfills many of my needs but there is one small thing that needs to be addressed. You need to have the ability not to be case sensitive on the filters for "StartsWith", "EndsWith", and "Contains".

Filtering by DateTime

I'm currently trying to filter by date but getting this error:

Operator '=' incompatible with operand types 'DateTime' and 'String'

Is there any problems with DateTime Filtering or I'm doing it wrong?

Thanks in advanced,

D.

Support "isempty" operator

We're using a kendo ui angular grid with the kendo-filter-isempty-operator, which causes the dlinq helper library to blow up since isempty isn't in the dictionary

Support for Kendo UI 'isnull' and 'isnotnull' filters

Kendo UI grid supports filtering columns based on 'NULL' or 'Not NULL' values.

These grid filters pass serialized 'Filter' objects to the server with string operators like 'isnull' and 'isnotnull' for the specified columns.

The Kendo.DynamicLinq.Filter collection of operators does not contain the 'isnull' or 'isnotnull' operators, and therefore there is an exception thrown when attempting to evaluate these filters using the ToDataSourceResult IQueryable extension method.

How can we gain support for these Kendo UI grid filters 'isnull' and 'isnotnull'?

Datatype of Filter.Value needs to be string instead of object

The datatype of Filter.Value needs to be of type string instead of 'object'. The reason behind this is when we post the data from the kendo-ui grid to asp.net controller's DataSourceRequest parameter, the value field gets populated with a string[1](array of strings with length=1). Thus when executing the query into SQL it throws below error:

Operator '=' incompatible with operand types 'String' and 'String[]'

If the 'Filter.Value' is of type string, it works just as expected.

No License info

Can you add some license info (like in the kendo-ui-forms project),

Kendo Grid api Server Error Handling

hi
how to Error Handling when Create or update record (inline and incell) with kendo api?

[HttpPost]
public virtual async Task CreatePersonnels([Bind(Prefix = "models")]IEnumerable models)
{
_accountService.Value.AddPersonnels(new List(model);
await _unitOfWork.SaveAllChangesAsync();
}
var queryString = Request.Url.ParseQueryString().GetKey(0);
var request = JsonConvert.DeserializeObject(queryString);
var resultData = new List();
return Json(resultData.AsQueryable().ToDataSourceResult(request, ModelState));
}
ModelState not use with ToDataSourceResult

how to use server error in client?
thank you

Problem in implementation in Generic repository pattern.

How do I use if I am using generic repository pattern. If my code structure is like this and using GET Methods:

Controller:
[HttpGet]
public async Task GetAllTemplate()
{
List templates = await _emailTemplateService.GetAllTemplate();
return Ok(templates);
}

RepositoryServices for DTO:

public async Task<list> GetAllTemplate()
{
IEnumerable Templates = await _unitWork.TemplateRepositoryUnit.GetAllTemplate();
List TemplateDtos = new List();
foreach (Template Template in templates)
{
templateDtos.Add(new TemplateDto
{
EtId = template.EtId.ToString(),
TemplateName template.EtName,
});
}
return templateDtos;
}

Repository:

public async Task<ienumerable> GetAllTemplate()
{
return await FindByCondition(et => et.EtIsDeleted != true).ToListAsync();

}

Should I need to create "ToDataSourceResult" extension method or this will be also come with nuget package of dot net core, In my implementation it is showing some problems related to ToDataSourceResult.
And should I use this with GET method as well, because I am getting all data through the and showing on grid with angular.

doesnotcontain should include null and empty values

When the doesnotcontain operator is used, ToExpression is currently just using !{field}.{comparison}(@{index}). This leaves out rows where the field value is null or empty, though. Checking the field for null or empty should produce a more accurate query and result. I'd be happy to submit a quick PR if you agree.

Does not work anymore with Kendo 2015.3.930

Parameters are NOT bound either when using DataSourceRequest object, or following parameters:
int take, int skip, IEnumerable sort, Kendo.DynamicLinq.Filter filter, IEnumerable aggregates

ToDataSourceResult and filtering with a decimal or double

When I call ToDataSourceResult with and integer filter it works fine; however, when trying to call ToDataSourceResult with a filter of a decimal or double, I am getting this error:

An exception of type 'System.Linq.Dynamic.ParseException' occurred in System.Linq.Dynamic.dll but was not handled in user code.
"Operator '=' incompatible with operand types 'Decimal?' and 'Double'".

image

image

Have you seen this? Any thoughts?

Support server grouping

Considering the Kendo UI DataSource supports serverGrouping, it would be beneficial if the dynamic GroupBy extension method could be used with the incoming group parameter to perform the appropriate grouping.

Support doesnotcontain operator

Users are able to include a "Does not contain" filter but the current Filter class does not have a mapping to Dynamic Linq for "doesnotcontain". I can submit a quick PR if you agree it's worth adding.

Set the default order to the primary key

If the request doen't have an ordering, the entity framework returns an error to do the paging, so it could be better to set the default ordering to the Primary key of the entity if it doesn't have any order.

just like this, but getting the correct field using reflection

    if (request.Sort == null || request.Sort.Count() == 0)
    {
        var sort = new List<Sort>();
        sort.Add(new Sort() { Dir = "asc", Field = "Id" });
        request.Sort = sort;
    }

Convert to enum automatically

If one field of the grid is an enum, if you filter you get an error,

I added this code to change the enums to their correct values, i could be done inside the library

private static void UpdateFilter(Filter filter)
{
if(filter==null)
{
return;
}
if (filter.Field != null)
{
var campo = filter.Field.Split('.');
var val = filter.Value;
var type = typeof(T);
foreach (var c in campo)
{
type = type.GetProperty(c).PropertyType;
}
if (type.IsEnum)
{
val = val ?? "0";
try
{
var enumVal = Enum.Parse(type, val.ToString());
filter.Value = enumVal;
}
catch { }

        }
    }
    if(filter.Filters ==null)
    {
        return;
    }
    foreach (var item in filter.Filters)
    {
        UpdateFilter<T>(item);
    }
}

Filters added twice

The Filter.Collect method should be modified as follows:

` private void Collect(List filters)
{
if (Filters != null && Filters.Any())
{
foreach (Filter filter in Filters)
{
filters.Add(filter);

                if (filter.Filters?.Count > 0) // add this line
                {                                         // add this line 
                    filter.Collect(filters);
                }                                         // add this line
            }
        }
        else
        {
            filters.Add(this);
        }
    }`

ToDataSourceResult does not enable a function to bind to a VM

General

The Kendo.Mvc.Extensions ToDataSourceResult has an overload that enables a function to be called in order to bind the result to VM/DTO this overload is missing in Kendo.DynamicLinq where only 3 overloads exist.

Attempts to work around

I tried to use the Kendo.Mvc.Extensions but the filters and sorts don't match up.
Using the Kendo.Mvc.Extensions made a huge improvement in performance as the DTO conversion was made after the data was filtered and sorted.

It will be great to have it.
10x

Not Applying Filter

I don't think the filter is being applied. From the results of ToDataSourceResult I can tell that the Take, Skip, and Sort are working as expected, but the Filter is not.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.