Example #1
0
        /// <summary>
        /// Converting to model type
        /// </summary>
        /// <param name="dbEntity"></param>
        /// <returns></returns>
        public static coreModel.Contact ToCoreModel(this dataModel.Contact dbEntity)
        {
            if (dbEntity == null)
            {
                throw new ArgumentNullException("dbEntity");
            }

            var retVal = new coreModel.Contact();

            dbEntity.ToCoreModel(retVal);
            retVal.Organizations = dbEntity.MemberRelations.Select(x => x.Ancestor).OfType <dataModel.Organization>().Select(x => x.Id).ToList();
            return(retVal);
        }