Beispiel #1
0
        public static ConsolidatedUserInformationResponseModel FindParentForLittle(int littleId)
        {
            using (var _context = new bbbsDbContext())
            {
                var mapping = (from lpm in _context.LittleParentMaps
                               where lpm.LittleId == littleId
                               select lpm).FirstOrDefault();
                UserAccount parentAccount = null;
                if (mapping != null)
                {
                    parentAccount = _context.UserAccounts.FirstOrDefault(x => x.Id == mapping.ParentId);
                }
                ConsolidatedUserInformationResponseModel uam = null;
                if (parentAccount != null)
                {
                    uam = TransformHelpers.UserAccountToConsResModel(parentAccount);
                }

                return(uam);
            }
        }