Skip to content

Instantly share code, notes, and snippets.

@foxxtrot
Created April 24, 2009 01:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save foxxtrot/100873 to your computer and use it in GitHub Desktop.
Save foxxtrot/100873 to your computer and use it in GitHub Desktop.
interface IAuthorization
{
String Item1 { get; set; }
String Item2 { get; set; }
String Item3 { get; set; }
}
public class App1Authorization
{
String Item1 { get; set; }
String Item2 { get; set; }
String Item3 { get { return null; } set {/* Do Nothing */} }
}
public class UserAuthorizations
{
public String UserName { get; set; }
public int UserId { get; set; }
public List<IAuthorization> Authorizations { get; set; }
}
public UserAuthorizations GetApp1Authorizations(int UserId)
{
return (from u in _context.Users
where u.WsuId == UserId
select new UserAuthorizations
{
UserName = u.FullName,
UserId = UserId,
Authorizations = (from ca in _context.App1Authorizations
where ca.UserWsuId == UserId
select new App1Authorization
{
Item1 = ca.Item1,
Item2 = ca.Item2
}).ToList()
}).Single();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment