public static MainDto ToDTO(this MainRecord entity)
        {
            if (entity == null) return null;

            var dto = new MainDto();

            dto.key = entity.Id;
            dto.title = entity.Title;
            dto.mainType = entity.MainTypeRecord.ToDTO();

            entity.OnDTO(dto);

            return dto;
        }
Example #2
0
        public static MainDto ToDTO(this MainRecord entity)
        {
            if (entity == null)
            {
                return(null);
            }

            var dto = new MainDto();

            dto.key      = entity.Id;
            dto.title    = entity.Title;
            dto.mainType = entity.MainTypeRecord.ToDTO();

            entity.OnDTO(dto);

            return(dto);
        }
Example #3
0
        public static MainRecord ToEntity(this MainDto dto)
        {
            if (dto == null)
            {
                return(null);
            }

            var entity = new MainRecord();

            entity.Id             = dto.key;
            entity.ParentId       = dto.parentId;
            entity.Title          = dto.title;
            entity.MainTypeRecord = dto.mainType.ToEntity();

            dto.OnEntity(entity);

            return(entity);
        }
partial         static void OnDTO(this MainRecord entity, MainDto dto);
Example #5
0
 static partial void OnEntity(this MainDto dto, MainRecord entity);
Example #6
0
 static partial void OnDTO(this MainRecord entity, MainDto dto);