protected override MethodArgs EntityToArgs(CategoryDto category, ActionType action) { var args = new MethodArgs { { nameof(category.Name), category.Name }, { nameof(category.Alias), category.Alias }, { nameof(category.Description), category.Description } }; if (action == ActionType.Create) { args.Add(nameof(category.Alias), category.Alias); } return(args); }
public Task <int> GetPagesCountAsync(PagesCountArgs pagesCountArgs) { var args = new MethodArgs { { nameof(pagesCountArgs.FrontPageStatus), pagesCountArgs.FrontPageStatus.ToString() }, { nameof(pagesCountArgs.ItemAvailableStatus), pagesCountArgs.ItemAvailableStatus.ToString() }, { nameof(pagesCountArgs.PublishStatus), pagesCountArgs.PublishStatus.ToString() }, { nameof(pagesCountArgs.PerPage), pagesCountArgs.PerPage.ToString() }, { "PostType.Id", pagesCountArgs.PostType.Id.ToString() } }; if (pagesCountArgs.Category != null) { args.Add("Category.Id", pagesCountArgs.Category?.Id.ToString()); } return(PostRequestAsync <int>(MethodNames.Posts.GetPagesCount, args)); }
protected override MethodArgs EntityToArgs(GroupDto group, ActionType action) { var args = new MethodArgs { { nameof(group.Description), group.Description }, { nameof(group.ChildGroups), ToStringEnumerable(group.ChildGroups) }, { nameof(group.GroupTypeId), group.GroupTypeId.ToString() }, { nameof(group.IsAdmin), group.IsAdmin.ToString() }, { nameof(group.GroupsRights), ToStringEnumerable(group.GroupsRights) }, { nameof(group.Name), group.Name }, { nameof(group.ParentGroupId), group.ParentGroupId?.ToString() } }; if (action == ActionType.Create) { args.Add(nameof(group.Alias), group.Alias); } return(args); }