public Models.User Get(Models.User dummy) { var entity = SiteDbContext.CreateDbContext().SiteUsers .Where(it => it.SiteName == dummy.Site.FullName && it.UserName == dummy.UserName) .FirstOrDefault(); return(entity == null ? null : SiteUserHelper.ToUser(entity)); }
public IEnumerable <Models.User> All(Models.Site site) { return(SiteDbContext.CreateDbContext().SiteUsers .Where(it => it.SiteName == site.FullName) .ToArray() .Select(it => SiteUserHelper.ToUser(it)) .AsQueryable()); }