Inheritance: DomainEntity
Exemple #1
0
 public virtual void AddPhoto(Photo fieldPhoto)
 {
     if (!fieldPhoto.IsNew() && _photos.Contains(fieldPhoto)) return;
     _photos.Add(fieldPhoto);
 }
        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;
        }
Exemple #3
0
 public virtual void RemovePhoto(Photo fieldPhoto)
 {
     _photos.Remove(fieldPhoto);
 }