Exemplo n.º 1
0
 private Stream ShowImage(int id)
 {
     using (var theGateContext = new TheGateContext())
     {
         var file = theGateContext.Files.First(f => f.fileID == id);
         return new MemoryStream(file.Data);
     }
 }
Exemplo n.º 2
0
 public SitePage()
 {
     _theGateContext = new TheGateContext();
     var userID = Membership.GetUser() != null ? (Guid)Membership.GetUser().ProviderUserKey : Guid.Empty;
     _contact = theGateContext.Contacts.Where(c => c.userID == userID).FirstOrDefault();
 }