LLbgen migration from 1.x to 5.7 version

47 Views Asked by At

Am working on LLbgen migration from 1.x to 5.7 version.. Am getting issues while building the newly migrated code.

Below is my existing code which using the LLBLGen version 1.x

public ISortExpression CreateSortExpression() 
{
 ISortExpression sorter = null; //add to switch new tables.
 switch (_sortTable) { 
case "UserEntity": 
sorter = new SortExpression(SortClauseFactory.Create((UserFieldIndex)_sortField, _sortDirection)); 
break; }

UserFieldIndex is a enum

After migration to 5.7 version , am getting The name 'SortClauseFactory' does not exist in the current context

sorter = new SortExpression(SortClauseFactory.Create((UserFieldIndex)_sortField, _sortDirection));

Could you please help me on this. Alternative way to rewrite based on 5.7 version.

https://www.llblgen.com/Documentation/5.9/LLBLGen%20Pro%20RTF/Using%20the%20generated%20code/Filtering%20and%20Sorting/gencode_sorting.htm

My dal :

namespace DALGeneric
{
    public enum UserFieldIndex
    {
        ///<summary>EmailAddress. </summary>
        EmailAddress,
        ///<summary>Extension. </summary>
        Extension,
        
}
}

and in my BL private SortOperator _sortDirection;

    private int _sortField;

    public SortOperator SortDirection
    {
        get { return _sortDirection; }
        set { _sortDirection = value; }
    }
    
    public int SortField
    {
        get { return _sortField; }
        set { _sortField = value; }
    }

sort field is column and sort direction is asc/desc

1

There are 1 best solutions below

0
On

As you've noticed, SortClauseFactory is no longer required. You can use (_sortField is an EntityField/EntityField2, _sortDirection is a SortOperator):

new SortExpression(_sortField | _sortDirection)