Join or Mutible DBContext Repository Generic c#

前端 未结 2 1748
我在风中等你
我在风中等你 2020-12-22 14:04

I have repository generic where I do method as Get,Update,Insert.

I get a data from table in data base I use this method.

 public IEnumerable

        
2条回答
  •  礼貌的吻别
    2020-12-22 14:21

    I find a form get this result for example Product and Category in repository Generic through include.

     public IEnumerable Get(Expression> newObjectEntity,int page, int rowsByPage, string include) where typeEntity : class
        {
           List Result = null;
                Result = Context.Set().Where(newObjectEntity).include(include).OrderBy(m => true).Skip(5 * (page - 1)).Take(rowsByPage).ToList();
            return Result;
        }
    

    With include you can string for example Product->Category and get this object.

提交回复
热议问题