Пример #1
0
 /*Custom methods for this repo */
 public IEnumerable <LifeEvent> GetLifeEventsCreatedByUser(int userId)
 {
     using (LifeEventsDBContext dbContext = new LifeEventsDBContext())
     {
         return((from e in dbContext.LifeEvents
                 where e.CreatedByUserId == userId
                 select e).ToList());
     }
 }
Пример #2
0
        /*Custom methods for this specific Repository */

        public User Get(string userName)
        {
            using (LifeEventsDBContext dbContext = new LifeEventsDBContext())
            {
                return((from e in dbContext.Users
                        where e.LoginName == userName
                        select e).FirstOrDefault());
            }
        }
Пример #3
0
        /*Custom methods for this specific Repository */

        public IEnumerable <RelationshipGroup> GetGroupsCreatedByUser(int userId)
        {
            using (LifeEventsDBContext dbContext = new LifeEventsDBContext())
            {
                return((from e in dbContext.RelationshipGroups
                        where e.CreatedByUserId == userId
                        select e).ToList());
            }
        }
Пример #4
0
 protected override User UpdateEntity(LifeEventsDBContext dbContext, User entity)
 {
     return((from e in dbContext.Users
             where e.UserId == entity.UserId
             select e).FirstOrDefault());
 }
Пример #5
0
 protected override User GetEntity(LifeEventsDBContext dbContext, int id)
 {
     return((from e in dbContext.Users
             where e.UserId == id
             select e).FirstOrDefault());
 }
Пример #6
0
 protected override IEnumerable <User> GetEntities(LifeEventsDBContext dbContext)
 {
     return(from e in dbContext.Users
            select e);
 }
Пример #7
0
 protected override User AddEntity(LifeEventsDBContext dbContext, User entity)
 {
     return(dbContext.Users.Add(entity));
 }
Пример #8
0
 protected override LifeEvent UpdateEntity(LifeEventsDBContext dbContext, LifeEvent entity)
 {
     return((from e in dbContext.LifeEvents
             where e.LifeEventId == entity.LifeEventId
             select e).FirstOrDefault());
 }
Пример #9
0
 protected override LifeEvent AddEntity(LifeEventsDBContext dbContext, LifeEvent entity)
 {
     return(dbContext.LifeEvents.Add(entity));
 }
Пример #10
0
 protected override RelationshipGroup UpdateEntity(LifeEventsDBContext dbContext, RelationshipGroup entity)
 {
     return((from e in dbContext.RelationshipGroups
             where e.RelationshipGroupId == entity.RelationshipGroupId
             select e).FirstOrDefault());
 }
Пример #11
0
 protected override RelationshipGroup GetEntity(LifeEventsDBContext dbContext, int id)
 {
     return((from e in dbContext.RelationshipGroups
             where e.RelationshipGroupId == id
             select e).FirstOrDefault());
 }
Пример #12
0
 protected override IEnumerable <RelationshipGroup> GetEntities(LifeEventsDBContext dbContext)
 {
     return(from e in dbContext.RelationshipGroups
            select e);
 }
Пример #13
0
 protected override RelationshipGroup AddEntity(LifeEventsDBContext dbContext, RelationshipGroup entity)
 {
     return(dbContext.RelationshipGroups.Add(entity));
 }