Example #1
0
 /// <summary>
 /// Parse a string into a <see cref="IConceptValue"/> object.
 /// </summary>
 /// <param name="path">The string to parse</param>
 /// <param name="conceptValue">The concept value that was parsed from <paramref name="path"/>.</param>
 public static bool TryParse(string path, out IConceptValue conceptValue)
 {
     conceptValue = null;
     if (string.IsNullOrWhiteSpace(path))
     {
         return(false);
     }
     try
     {
         var result = PathRegex.Matches(path);
         if (result.Count != 1)
         {
             return(false);
         }
         var groups = result[0].Groups;
         if (groups.Count != 4)
         {
             return(false);
         }
         conceptValue = new ConceptValue
         {
             ConceptName = groups[1].Value,
             ContextName = groups[2].Value.StartsWith("~") ? null : groups[2].Value,
             ClientName  = groups[2].Value.StartsWith("~") ? groups[2].Value.Substring(1) : null,
             Value       = groups[3].Value
         };
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Example #2
0
        public Task <IProduct> ReadAsync(IConceptValue id)
        {
            InternalContract.RequireNotNull(id, nameof(id));
            InternalContract.RequireValidated(id, nameof(id));
            var dalProduct = await _productPersistance.ReadAsync(ToDal(id)).ConfigureAwait(false);

            return(FromDal(dalProduct));
        }
Example #3
0
 public Task DeleteAsync(IConceptValue id)
 {
     throw new System.NotImplementedException();
 }