Inheritance: DomainEntity
Example #1
0
 public virtual void AddPhoto(Photo fieldPhoto)
 {
     if (!fieldPhoto.IsNew() && _photos.Contains(fieldPhoto)) return;
     _photos.Add(fieldPhoto);
 }
Example #2
0
        private Photo mapToDomain(PhotoViewModel input, Photo photo)
        {
            var photoModel = input.Photo;
            photo.FileType = photoModel.FileType;

            photo.Name = photoModel.Name;
            photo.Description = photoModel.Description;
            if (photo.PhotoCategory == null || photo.PhotoCategory.EntityId != input.PhotoCategory)
            {
                photo.PhotoCategory = _repository.Find<PhotoCategory>(input.Photo.PhotoCategory.EntityId);
            }
            return photo;
        }
Example #3
0
 public virtual void RemovePhoto(Photo fieldPhoto)
 {
     _photos.Remove(fieldPhoto);
 }