public virtual ApiCallTypeClientRequestModel MapServerResponseToClientRequest( ApiCallTypeServerResponseModel response) { var request = new ApiCallTypeClientRequestModel(); request.SetProperties( response.Name); return(request); }
public virtual ApiCallTypeServerResponseModel MapEntityToModel( CallType item) { var model = new ApiCallTypeServerResponseModel(); model.SetProperties(item.Id, item.Name); return(model); }
public virtual ApiCallTypeServerResponseModel MapServerRequestToResponse( int id, ApiCallTypeServerRequestModel request) { var response = new ApiCallTypeServerResponseModel(); response.SetProperties(id, request.Name); return(response); }
public void MapEntityToModel() { var mapper = new DALCallTypeMapper(); CallType item = new CallType(); item.SetProperties(1, "A"); ApiCallTypeServerResponseModel response = mapper.MapEntityToModel(item); response.Id.Should().Be(1); response.Name.Should().Be("A"); }
public virtual async Task <UpdateResponse <ApiCallTypeServerResponseModel> > Update( int id, ApiCallTypeServerRequestModel model) { var validationResult = await this.CallTypeModelValidator.ValidateUpdateAsync(id, model); if (validationResult.IsValid) { CallType record = this.DalCallTypeMapper.MapModelToEntity(id, model); await this.CallTypeRepository.Update(record); record = await this.CallTypeRepository.Get(id); ApiCallTypeServerResponseModel apiModel = this.DalCallTypeMapper.MapEntityToModel(record); await this.mediator.Publish(new CallTypeUpdatedNotification(apiModel)); return(ValidationResponseFactory <ApiCallTypeServerResponseModel> .UpdateResponse(apiModel)); } else { return(ValidationResponseFactory <ApiCallTypeServerResponseModel> .UpdateResponse(validationResult)); } }
public CallTypeUpdatedNotification(ApiCallTypeServerResponseModel record) { this.Record = record; }
public virtual ApiCallServerResponseModel MapEntityToModel( Call item) { var model = new ApiCallServerResponseModel(); model.SetProperties(item.Id, item.AddressId, item.CallDispositionId, item.CallStatusId, item.CallString, item.CallTypeId, item.DateCleared, item.DateCreated, item.DateDispatched, item.QuickCallNumber); if (item.AddressIdNavigation != null) { var addressIdModel = new ApiAddressServerResponseModel(); addressIdModel.SetProperties( item.AddressIdNavigation.Id, item.AddressIdNavigation.Address1, item.AddressIdNavigation.Address2, item.AddressIdNavigation.City, item.AddressIdNavigation.State, item.AddressIdNavigation.Zip); model.SetAddressIdNavigation(addressIdModel); } if (item.CallDispositionIdNavigation != null) { var callDispositionIdModel = new ApiCallDispositionServerResponseModel(); callDispositionIdModel.SetProperties( item.CallDispositionIdNavigation.Id, item.CallDispositionIdNavigation.Name); model.SetCallDispositionIdNavigation(callDispositionIdModel); } if (item.CallStatusIdNavigation != null) { var callStatusIdModel = new ApiCallStatusServerResponseModel(); callStatusIdModel.SetProperties( item.CallStatusIdNavigation.Id, item.CallStatusIdNavigation.Name); model.SetCallStatusIdNavigation(callStatusIdModel); } if (item.CallTypeIdNavigation != null) { var callTypeIdModel = new ApiCallTypeServerResponseModel(); callTypeIdModel.SetProperties( item.CallTypeIdNavigation.Id, item.CallTypeIdNavigation.Name); model.SetCallTypeIdNavigation(callTypeIdModel); } return(model); }
public void SetCallTypeIdNavigation(ApiCallTypeServerResponseModel value) { this.CallTypeIdNavigation = value; }