Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • EV 36 posts 147 karma points
    Aug 29, 2019 @ 06:20
    EV
    0

    Fluidity: Server Error "Failed to get entities"

    Hi, I've just added the package to my project, and it looks really nice and very promising. However, unless I set:

    collectionConfig.SetSortProperty(p => p.FullName, SortDirection.Descending);
    

    it keeps throwing a Server error "Failed to get entities". It doesn't work even if I put the sort direction as Ascending instead of Descending. Additionally, no matter what's the size of the page, I always get the error from above ('Failed to get entities'). I really don't understand why is this happening.

    Here's my model:

    [TableName("CustomUsers")]
    [PrimaryKey("Id", autoIncrement = true)]
    [ExplicitColumns]
    public class CustomUser
    {
        [Column("Id")]
        [PrimaryKeyColumn(AutoIncrement = true)]
        public int Id { get; set; }
    
        [Column("UserId")]
        public int UserId { get; set; }
    
        [Column("FullName")]
        public string FullName { get; set; }
    
        [Column("Address")]
        public string Address { get; set; }
    
        [Column("City")]
        public string City { get; set; }
    
        [Column("Country")]
        public string Country { get; set; }
    
        [Column("Telephone")]
        public string Telephone { get; set; }
    
        [Column("Occupation")]
        public string Occupation { get; set; }
    
    }
    

    Here's my configuration class:

    public class FluidityBootstrap : FluidityConfigModule
    {
        public override void Configure(FluidityConfig config)
        {
            config.AddSection("CustomUsers", "icon-server-alt", sectionConfig =>
            {
                sectionConfig.SetTree("CustomUsers", treeConfig =>
                {
                    treeConfig.AddCollection<CustomUser>(p => p.Id, "CustomUser", "CustomUsers", "A collection of custom users",
                        collectionConfig =>
                        {
                            collectionConfig.SetNameProperty(p => p.FullName);
                            collectionConfig.SetViewMode(FluidityViewMode.List);
    
                            collectionConfig.ListView(listViewConfig =>
                            {
                                listViewConfig.SetPageSize(15);
    
                                listViewConfig.AddField(p => p.Address);
                                listViewConfig.AddField(p => p.City);
                                listViewConfig.AddField(p => p.Country);
                                listViewConfig.AddField(p => p.Telephone);
                                listViewConfig.AddField(p => p.Occupation);
                            });
    
                            collectionConfig.Editor(editorConfig =>
                            {
                                editorConfig.AddTab("User Info", tabConfig =>
                                {
                                    tabConfig.AddField(p => p.FullName, fieldConfig =>
                                    {
                                        fieldConfig.SetLabel("Full Name");
                                    });
                                    tabConfig.AddField(p => p.Address);
                                    tabConfig.AddField(p => p.City);
                                    tabConfig.AddField(p => p.Country);
                                    tabConfig.AddField(p => p.Telephone);
                                    tabConfig.AddField(p => p.Occupation);
                                });
                            });
    
                            //must be added for Listview to work
                            collectionConfig.SetSortProperty(p => p.FullName, SortDirection.Descending);
    
                            collectionConfig.AddSearchableProperty(p => p.FullName);
                        });
                });
    
            });
        }
    }
    
  • EV 36 posts 147 karma points
    Aug 29, 2019 @ 06:41
    EV
    100

    I first posted this as a Github issue on Tuesday. Yesterday it was a holiday so I wasn't at work, today I come in (not having changed anything) and it's working. I even tried it with ascending sort. It even works with removing the sort completely! I really don't understand why this happened lol. If I find out more info, will let you know.

Please Sign in or register to post replies

Write your reply to:

Draft