GithubHelp home page GithubHelp logo

anton-martyniuk / modern Goto Github PK

View Code? Open in Web Editor NEW
17.0 17.0 2.0 598 KB

.NET modern tools for fast and efficient development

License: Apache License 2.0

C# 100.00%
aspnetcore controllers cqrs cshap dapper dotnet efcore fastdevelopment genericcontroller genericrepository genericservice litedb modern mongodb repositories services unitofwork

modern's Issues

Can't do Register Filtering Query through validation of filter query

Conditions:
using Modern.Repositories.Abstractions, Version=1.0.0.0

Stages of reproduction:

  1. Create specifications - need two or more.

new FilterByClientSpecification(x.Client),

AddFilteringQuery(x => x.Client != null
&& clients.Contains(x.Client.Name, StringComparer.Ordinal));

new FilterByCustomerSpecification(x.Customer),

AddFilteringQuery(
x => x.Customer != null && customers.Any(t => x.Customer.Contains(t, StringComparison.OrdinalIgnoreCase)));

  1. Register specifications into EfCoreSpecification

var registerSpecification = specifications.Aggregate((current, next) => current.And(next));
var efCoreSpecification = new EfCoreSpecification(registerSpecification );
4. Send a request POST with selected specifications

Expected result:
We expect filtering with selected specifications: especially if one have been chosen

Actual result:
Can't do Register Filtering Query through validation of filter query. In that method:

private void RegisterFilteringQuery(Specification left, Specification right)

Cache mismatch

Hi

When option AddOrUpdateInCacheWhenEntityIsUpdated is enabled, Update method stores dto to cache without includes. When option is disabled we can take only outdated dto from cache with Get methods
So we in trap)

I think it is necessary to delete from the cache when updating and the option AddOrUpdateInCacheWhenEntityIsUpdated is disabled

Something like

if (!_options.Value.AddOrUpdateInCacheWhenEntityIsUpdated)
{
   await Cache.DeleteAsync(id).ConfigureAwait(false);
   return MapToDto(entityDbo);
}

Thank you for awesome framework!

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.