Example #1
0
        internal static model.Buddy MakeEntityBuddy(contract.Buddy buddy, long ProfileID, bool updateState = true)
        {
            if (buddy == null)
            {
                return(null);
            }

            var buddyEntity = new model.Buddy
            {
                BuddyID        = buddy.BuddyID,
                ProfileID      = ProfileID,
                UserID         = buddy.UserID,
                BuddyName      = buddy.Name,
                MobileNumber   = utility.Security.Encrypt(buddy.MobileNumber),
                Email          = buddy.Email,
                IsPrimeBuddy   = buddy.IsPrimeBuddy,
                SubscribtionId = buddy.SubscribtionID
            };

            if (updateState)
            {
                buddyEntity.State = (model.BuddyState)buddy.State;
            }
            return(buddyEntity);
        }
Example #2
0
 public static SOS.Model.Buddy ConvertToModelBuddy(this SOS.Service.Interfaces.DataContracts.Buddy buddy)
 {
     return(AutoMapper.Mapper.Map <SOS.Model.Buddy>(buddy));
 }