Beispiel #1
0
        /// <summary>
        /// Adds the contact photo.
        /// </summary>
        /// <param name="contactPhoto">The contact photo.</param>
        /// <returns></returns>
        public Response <ContactPhotoViewModel> AddContactPhoto(ContactPhotoViewModel contactPhoto)
        {
            const string apiUrl   = baseRoute + "AddContactPhoto";
            var          response = communicationManager.Post <ContactPhotoModel, Response <ContactPhotoModel> >(contactPhoto.ToModel(), apiUrl);

            return(response.ToViewModel());
        }
Beispiel #2
0
        /// <summary>
        /// To the view model.
        /// </summary>
        /// <param name="entity">The entity.</param>
        /// <returns></returns>
        public static ContactPhotoViewModel ToViewModel(this ContactPhotoModel entity)
        {
            if (entity == null)
            {
                return(null);
            }

            var model = new ContactPhotoViewModel
            {
                ContactPhotoID = entity.ContactPhotoID,
                ContactID      = entity.ContactID,
                PhotoID        = entity.PhotoID,
                PhotoBLOB      = entity.PhotoBLOB,
                ThumbnailBLOB  = entity.ThumbnailBLOB,
                IsPrimary      = entity.IsPrimary,
                ModifiedOn     = entity.ModifiedOn
            };

            return(model);
        }
Beispiel #3
0
        /// <summary>
        /// To the model.
        /// </summary>
        /// <param name="model">The model.</param>
        /// <returns></returns>
        public static ContactPhotoModel ToModel(this ContactPhotoViewModel model)
        {
            if (model == null)
            {
                return(null);
            }

            var entity = new ContactPhotoModel
            {
                ContactPhotoID = model.ContactPhotoID,
                ContactID      = model.ContactID,
                PhotoID        = model.PhotoID,
                PhotoBLOB      = model.PhotoBLOB,
                ThumbnailBLOB  = model.ThumbnailBLOB,
                IsPrimary      = model.IsPrimary,
                ModifiedOn     = model.ModifiedOn
            };

            return(entity);
        }
Beispiel #4
0
 public Response <ContactPhotoViewModel> UpdateContactPhoto(ContactPhotoViewModel contactPhoto)
 {
     return(_contactPhotoRepository.UpdateContactPhoto(contactPhoto));
 }