OpenAuth.Net/OpenAuth.Repository/OrgRepository.cs

29 lines
718 B
C#
Raw Normal View History

2015-10-26 21:58:12 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OpenAuth.Domain;
using OpenAuth.Domain.Interface;
namespace OpenAuth.Repository
{
public class OrgRepository : BaseRepository<Org>, IOrgRepository
{
public IEnumerable<Org> LoadOrgs()
{
return Find();
}
2015-11-13 21:33:53 +08:00
public IEnumerable<Org> LoadByUser(int userId)
{
var result = from userorg in Context.UserOrgs
join org in Context.Orgs on userorg.OrgId equals org.Id
where userorg.UserId == userId
select org;
return result;
}
2015-10-26 21:58:12 +08:00
}
}