GithubHelp home page GithubHelp logo

coronabytes / dotnet-arangodb-extensions Goto Github PK

View Code? Open in Web Editor NEW
12.0 2.0 4.0 587 KB

Serilog, DevExtreme and DataProtection extensions for .NET ArangoDB driver

License: MIT License

C# 100.00%
serilog netcore dataprotection devextreme-query aspnetcore serilog-sink arangodb arangodb-client

dotnet-arangodb-extensions's People

Contributors

asolomatin avatar coronabytes avatar harrycordewener avatar raphael-hettich avatar

Stargazers

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

Watchers

 avatar  avatar

dotnet-arangodb-extensions's Issues

Devextreme extensión filtering and sorting

I'm testing Devextreme extension with a dxDataGrid and filtering and sorting operations only works with key field, not working with other fields

This is the dxDataGrid

@(Html.DevExtreme().DataGrid()
.ShowBorders(true)
.DataSource(d => d.Mvc().Controller("SampleData").LoadAction("Get").Key("_id"))
.Columns(columns => {
columns.Add().DataField("_key");
columns.Add().DataField("name");
columns.Add().DataField("population");
columns.Add().DataField("isCapital");
})
.Paging(p => p.PageSize(10))
.FilterRow(f => f.Visible(true))
.HeaderFilter(f => f.Visible(true))
.RemoteOperations(true)

This is my api

[Route("api/[controller]")]
public class SampleDataController : Controller {

    [HttpGet]
    public async Task<object> Get(DataSourceLoadOptions loadOptions) {

        // from connection string
        var arango = new ArangoContext("Server=http://localhost:8529;User=root;Password=12345678a.;");
        ArangoHandle db = new ArangoHandle("TEST");
        var arangoTransform = new ArangoTransform(loadOptions, Transform);
        if (!arangoTransform.Transform(out var error))
            return BadRequest(error);

        var data= await arangoTransform.ExecuteAsync<City>(arango, db, "germanCity");

        return data;
        //return DataSourceLoader.Load(SampleData.Orders, loadOptions);
    }

    private static readonly ArangoTransformSettings Transform = new ArangoTransformSettings
    {
        IteratorVar = "x",
        Key = "key",
        //Filter = "x.Active == true",
    };

    public class Geometry
    {
        public string type { get; set; }
        public List<double> coordinates { get; set; }
    }

    public class City
    {
        public string _key { get; set; }
        public string _id { get; set; }
        public string _rev { get; set; }
        public string name { get; set; }
        public int population { get; set; }
        public bool isCapital { get; set; }
        public Geometry geometry { get; set; }
    }
}

this is my collection data

[{"_key":"Berlin","_id":"germanCity/Berlin","_rev":"_e_x6lZm---","name":"Berlin","population":3000000,"isCapital":true,"geometry":{"type":"Point","coordinates":[13.3833,52.5167]}},{"_key":"Hamburg","_id":"germanCity/Hamburg","_rev":"_e_x63Wi---","name":"Hamburg","population":1000000,"isCapital":false,"geometry":{"type":"Point","coordinates":[10.0014,53.5653]}},{"_key":"Cologne","_id":"germanCity/Cologne","_rev":"_e_x7HEi---","name":"Cologne","population":1000000,"isCapital":false,"geometry":{"type":"Point","coordinates":[6.9528,50.9364]}}]

DxLoadResult Json attributes

Hi,

Can you please add JsonProperty and JsonPropertyName attributes to properties on the DxLoadResult class, just as they exist in DxGroupResult?

Thanks

ArangoSerilogSink example need to be updated

ArangoSerilogSink doesn't match the example anymore

batchPostingLimit: 50, TimeSpan.FromSeconds(2)

aren't part of the ctor anymore, and when removed

you get : cannot convert from 'Core.Arango.Serilog.ArangoSerilogSink' to 'Serilog.Core.ILogEventSink'

Bug: Migration Exceptions are hidden and cause Deadlocks

I have a Migration written. When an error is thrown (Because the Database does not exist, or a Schema item fails to match), it should be throwing an Exception. Instead, the error seems to be swallowed up and it deadlocks.

Collection = new ArangoCollection
{
		Name = "node_objects",
		Type = ArangoCollectionType.Document,
		KeyOptions = new ArangoKeyOptions()
		{
				AllowUserKeys = true,
				Type = ArangoKeyType.Traditional
		},
		Schema = new ArangoSchema()
		{
				Rule = new {
						properties = new {
								DBRef = new { type = "number", multipleOf = 1 },
								Name = new { type = "string" },
								Locks = new { type = "object" },
								CreationTime = new { type = "number" },
								Powers = new { type = "array", items = "string" }
						},
						required = (string[])[nameof(SharpObject.DBRef), nameof(SharpObject.Name)]
				}
		}
var roomZeroObj = await migrator.Context.Document.CreateAsync(handle, "node_objects", new SharpObject
{
		Name = "Room Zero",
		DBRef = 0,
		CreationTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
});
Core.Arango.ArangoException
  HResult=0x80131500
  Message=[{"error":true,"errorNum":1620,"errorMessage":"schema validation failed"}]
  Source=Core.Arango
  StackTrace:
   at Core.Arango.Transport.ArangoHttpTransport.<SendAsync>d__6`1.MoveNext()
   at Core.Arango.Modules.Internal.ArangoDocumentModule.<CreateManyAsync>d__3`2.MoveNext()
   at Core.Arango.Modules.Internal.ArangoDocumentModule.<CreateAsync>d__6`1.MoveNext()
   at SharpMUSH.Database.Migrations.Migration_CreateDatabase.<Up>d__4.MoveNext() in D:\CSharpPennMUSH\SharpMUSH.Database\Migrations\Migration_CreateDatabase.cs:line 303

  This exception was originally thrown at this call stack:
    [External Code]
    SharpMUSH.Database.Migrations.Migration_CreateDatabase.Up(Core.Arango.Migration.IArangoMigrator, Core.Arango.ArangoHandle) in Migration_CreateDatabase.cs

I can see the exceptions if I turn on all CLR Exceptions.

LINQ extensions do not honor JSON naming policy

If you use a camel case json policy (or any other non default policy) on your documents, the query generated by the LINQ extensions do not generate correct queries.

For instance:

class Document
{
public string Label{get;set;} = "value"
}

Serializes to:

{ label: "value" }

and a query like: ...Where(e.Label == "value") will generate a query for "Label", not "label".

Devextreme extension Select options

How can I use the select options? I always getting an error.

passing

{
"select": [
"x.Nombre"
]
}

I get

"Message": "Unexpected character encountered while parsing value: x. Path '', line 0, position 0.",

If i try with {

"select": [
"Nombre"
]
}

I get

"Message": "Error parsing NaN value. Path '', line 1, position 1.",

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.