开发者

S#arp Architecture NHibernate 3 and Linq Changes

开发者 https://www.devze.com 2023-02-13 02:15 出处:网络
I have just started to use the newest version of S#arp Architecture 1.9.5, which has made the change to NHibernate 3, this has a new Linq providor.

I have just started to use the newest version of S#arp Architecture 1.9.5, which has made the change to NHibernate 3, this has a new Linq providor.

I just to be able to add custom methods in using the following code.

public class ClientBusinessTypeRepository : NHibernateRepos开发者_开发百科itory<ClientBusinessType>, IClientBusinessTypeRepository
    {
        public IList<ClientBusinessType> GetByName(string name)
        {
            return Session.Linq<ClientBusinessType>().Where(cbt=>cbt.Name == name).ToList();
        }

    }

Now I know I need to change the return line to use the new Linq, just not sure how


Just change the 'Linq' method to 'Query'.

0

精彩评论

暂无评论...
验证码 换一张
取 消