Beispiel #1
0
 public ReleaseDTO CreateRelease(ReleaseDTO instance)
 {
     return Release.AddOrUpdateRelease(instance.ToEntity()).ToDTO();
 }
Beispiel #2
0
        /// <summary>
        /// Invoked when <see cref="ToDTO"/> operation is about to return.
        /// </summary>
        /// <param name="dto"><see cref="ReleaseDTO"/> converted from <see cref="Release"/>.</param>
partial         static void OnDTO(this Release entity, ReleaseDTO dto);
Beispiel #3
0
 public ReleaseDTO UpdateReleae(string id, ReleaseDTO instance)
 {
     return Release.UpdateRelease(int.Parse(id), instance).ToDTO();
 }
Beispiel #4
0
        /// <summary>
        /// Converts this instance of <see cref="Release"/> to an instance of <see cref="ReleaseDTO"/>.
        /// </summary>
        /// <param name="entity"><see cref="Release"/> to convert.</param>
        public static ReleaseDTO ToDTO(this Release entity)
        {
            if (entity == null) return null;

            var dto = new ReleaseDTO();

            dto.ReleaseId = entity.ReleaseId;
            dto.Name = entity.Name;
            dto.Description = entity.Description;
            dto.Path = entity.Path;
            dto.ProductId = entity.ProductId;

            entity.OnDTO(dto);

            return dto;
        }