public ResponseDTO Create(RefTypeDTO DTO)
        {
            RefType entity = this.mapper.Map <RefType>(DTO);

            this.unitOfWork.Repository <RefType>().Create(entity);
            return(CreateResponse <RefTypeDTO> .Return(DTO, "Create"));
        }
        public ResponseDTO <RefTypeDTO> Delete(RefTypeDTO DTO)
        {
            var entity = unitOfWork.Repository <RefType>().GetByKey(DTO.Id);

            unitOfWork.Repository <RefType>().Delete(entity);
            unitOfWork.EndTransaction();
            return(CreateResponse <RefTypeDTO> .Return(DTO, "Delete"));
        }
        public ResponseDTO <RefTypeDTO> Update(RefTypeDTO DTO)
        {
            var entity = unitOfWork.Repository <RefType>().GetByKey(DTO.Id);

            entity.Update(DTO.Status, DTO.Name, DTO.IsActive, DTO.UpdateDate);
            unitOfWork.Repository <RefType>().Update(entity);
            unitOfWork.EndTransaction();
            return(CreateResponse <RefTypeDTO> .Return(DTO, "Update"));
        }
 public ResponseDTO <RefTypeDTO> Create(RefTypeDTO DTO)
 {
     throw new NotImplementedException();
 }
 public IActionResult AddRefType([FromBody] RefTypeDTO request)
 {
     return(Ok(this.appService.AddRefType(request)));
 }
 public ResponseDTO AddRefType(RefTypeDTO request)
 {
     return(this.refTypeService.Create(request));
 }
示例#7
0
 public ResponseDTO <RefTypeDTO> DeleteRefType(RefTypeDTO request)
 {
     return(this.refTypeService.Delete(request));
 }
示例#8
0
 public Task <RefTypeDTO> GetRefTypeById(RefTypeDTO contextSource) =>
 this.refTypeService.GetById(contextSource.Id);
示例#9
0
        public Task <RefTypeDTO> Handle(RefTypeDTO request, CancellationToken cancellationToken)
        {
            var entity = this.unitOfWork.Repository <RefType>().Query().Filter(x => x.Id == request.Id).Get().FirstOrDefault();

            return(Task.FromResult(Mapper.Map(entity, new RefTypeDTO())));
        }