예제 #1
0
 public EsStateBuilder()
 {
     _esState           = new EsState();
     _esState.Documents = new string[0];
     _esState.Mapping   = "";
     _esState.Query     = "";
     _esState.StateUrl  = Guid.Empty;
 }
예제 #2
0
        public async Task <EsfStateResponseDto> Get()
        {
            EsState newState = await _newEsfStateFactory.GetNewState();

            var esfState = _mapper.Map <EsState, ExistingEsfStateDto>(newState);

            return(new EsfStateResponseDto
            {
                EsfState = esfState
            });
        }
예제 #3
0
        public async Task <EsfStateResponseDto> Get(string stateUrl)
        {
            Guid    parsedStateUrl = Guid.Parse(stateUrl);
            EsState storedState    = await _esStatesRepository.FindEsState((state) => state.StateUrl == parsedStateUrl);

            var newState = _mapper.Map <EsState, ExistingEsfStateDto>(storedState);

            return(new EsfStateResponseDto
            {
                EsfState = newState
            });
        }
예제 #4
0
 public static ExistingEsfStateDto FromExisting(EsState esState)
 {
     return(new ExistingEsfStateDto()
     {
         StateUrl = esState.StateUrl.ToString(),
         State = new EsfStateDto()
         {
             Documents = esState.Documents,
             Mapping = esState.Mapping,
             Query = esState.Query
         }
     });
 }