Coder Social home page Coder Social logo

cosmosdb-repo's People

Contributors

aarondcoleman avatar powelgithub avatar spoofi 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

Watchers

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

cosmosdb-repo's Issues

Nuget Package update

Hi there. I really love this library.
I'm using the 1.1.0 Nuget Package version and it doesn't seem to include the Interface for DocumentDbRepository yet. Any plans to update the Nuget package? Thanks a lot!

public async Task<ModelObject> doesn't works

Hi,
I want to use AddOrUpdateAsync and return its result but it doesn't work.

 public async Task<CompanyVm> CreateCompanyAndReturn(CompanyVm companyItem)
        {
            var result = await base.Repository.AddOrUpdateAsync(companyItem);

            return result;
        }

Also I tried

 public CompanyVm CreateCompanyAndReturn(CompanyVm companyItem)
        {
            var result = base.Repository.AddOrUpdateAsync(companyItem).Result;

            return result;
        }

This code works

public async void CreateCompany(CompanyVm companyItem)
       {
           var result = await base.Repository.AddOrUpdateAsync(companyItem);
       }

Nuget package

Hi,

Your project looks very good. Is it available as a Nuget package?

Best,

Søren

Fails to create a collection when no collection name provided

Bug in class DocumentDbRepository.cs. Line 37 must be executed before line 35, otherwise an Exception will be thrown in method GetOrCreateCollectionAsync() line 189: collection = await _client.CreateDocumentCollectionAsync((await _database).SelfLink, collection); because collection is always null.

Non String JsonProperty for Id does'nt work

Consider the following POCO

public class Foo
{
    [JsonProperty(PropertyName = "id")]
    public Guid MessageUid { get; set; }
}

Using this POCO throw's an exception at the line 👍
var exp = Expression.Lambda<Func<T, string>>(body, p);

I'm currently learning and researching lamba's as I don't expression building very well but any help would be most welcome.

Issue with the FirstOrDefaultAsync method

  1. The FirstOrDefaultAsync(Func<T, bool> predicate) method takes the predicate 'Func<T, bool> predicate' which is taking a lot of time to execute, instead of Func<T, bool> predicate if we change to 'Expression<Func<T, bool>> predicate' it is working much faster ( at least 10 times faster).Is it an issue or a behavior?

  2. The other issue with RemoveAsync is not working with the partitioned collection is because of even if 'RemoveAsync' method takes RequestOptions as a parameter which is not passed to GetDocumentByIdAsync(id).We might need a Get method which takes partition key as FeedOptions.

  3. The WhereAsync methods return an IQueryable which is fine for most cases, but there are some issues I have faced with sharing context when WhereAsync used in the fully async code.It is very useful if you could provide an option for WhereAsync which returns the result after enumeration, like a List or similar.

  4. update to the latest azure documentdb package

GetById queries are slow

Hi,
I'm having strange issue with performance of GetById queries - while any other query takes no longer than 1 sec (this is locally deployed app connecting to Azure), GetById query takes 15+ seconds.
So far I'm working with relatively small dataset (between 1-2 thousands documents). I am using GUIDs for Id property.

I tried to play a bit with indexing but DocumentDB will not allow me to directly index Id field so I'm using:

{
      "path": "/*",
      "indexes": [
        {
          "kind": "Hash",
          "dataType": "String",
          "precision": -1
        },
        {
          "kind": "Hash",
          "dataType": "Number",
          "precision": 7
        }
      ]
    }

In my code, I declare my repo like this:

_repoAggregationLog = new DocumentDbRepository<AggregationLog>(client, databaseId, () => "vd", p => p.Id);

and it is declared as singleton for application lifetime, i.e. this is executed only once, not with every query.

Any idea what I can be doing wrong? Or is it normal that queries by document ID takes so long?

Many thanks,

Antonin

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.