Skip to content

Custom builder causes exception when setting up model #6093

@Iankodj

Description

@Iankodj

Bug report

It is snot possible to set up a custom DataSource with custom Model.

Reproduction of the problem

@(Html.Kendo().FileManager().Name("filemanager")
   .DataSource(ds => ds
        .Custom()
        .Transport(transport =>
        {
            transport.Read(operation => operation
            .Type(HttpVerbs.Post)
            .Action("Read", "FileManagerData"));
            transport.Destroy(operation => operation
                .Type(HttpVerbs.Post)
                .Action("Destroy", "FileManagerData")
            );
            transport.Create(operation => operation
                .Type(HttpVerbs.Post)
                .Action("Create", "FileManagerData")
            );
            transport.Update(operation => operation
                .Type(HttpVerbs.Post)
                .Action("Update", "FileManagerData")
            );

        })
        .Schema(schema =>
        {
            schema.Model(model =>
            {
                model.Id("path");
                model.HasChildren("hasDirectories");
                model.Field("name", typeof(String)).Editable(true).From("Name").DefaultValue("New Folder");
                model.Field("size", typeof(String)).Editable(false).From("Size");
                model.Field("path", typeof(String)).Editable(false).From("Path");
                model.Field("extension", typeof(String)).Editable(false).From("Extension");
                model.Field("isDirectory", typeof(Boolean)).Editable(false).From("IsDirectory").DefaultValue(true);
                model.Field("hasDirectories", typeof(Boolean)).Editable(false).From("HasDirectories").DefaultValue(false);
                model.Field("created", typeof(DateTime)).Editable(false).From("Created");
                model.Field("createdUtc", typeof(DateTime)).Editable(false).From("CreatedUtc");
                model.Field("modified", typeof(DateTime)).Editable(false).From("Modified");
                model.Field("modifiedUtc", typeof(DateTime)).Editable(false).From("ModifiedUtc");

            });
        })
    )
)

Current behavior

image

Expected/desired behavior

Set up custom model

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions