public IRecipe GetRecipe(ICandidateKey recipeKey)
 {
     string fileName = recipeKey.Key as string;
      if (string.IsNullOrEmpty(fileName))
     return null;
      return LoadRecipe (fileName);
 }
예제 #2
0
        public void AddCandidateKey(ICandidateKey key)
        {
            if (key == null)
            {
                throw new ArgumentNullException("key");
            }

            _candidateKeys.Add(key);
        }
예제 #3
0
        public IRecipe GetRecipe(ICandidateKey recipeKey)
        {
            string fileName = recipeKey.Key as string;

            if (string.IsNullOrEmpty(fileName))
            {
                return(null);
            }
            return(LoadRecipe(fileName));
        }
예제 #4
0
        public ForeignKey(ICandidateKey candidateKey, string nameSource, string nameTarget, Cardinality cardinality) : base(nameSource, nameTarget)
        {
            if (candidateKey == null)
            {
                throw new ArgumentNullException("candidateKey");
            }

            _candidateKey = candidateKey;
            _cardinality  = cardinality;
        }
예제 #5
0
 public static IRecipe GetRecipeNoThrow(this IRecipeService service, ICandidateKey id)
 {
     try
     {
         return(service.GetRecipe(id));
     }
     catch
     {
         return(null);
     }
 }
예제 #6
0
        private void AddPrimaryKey(XmlElement parent, ICandidateKey key)
        {
            var primaryKey = AddElement(parent, "primaryKey");

            AddElement(primaryKey, "name", MakeSqlIdentifier(key.NameTarget));

            foreach (var field in key.Fields)
            {
                AddElement(primaryKey, "column", MakeSqlIdentifier(field.Key.NameTarget));
            }
        }
예제 #7
0
 public IRecipe GetRecipe(ICandidateKey recipeId)
 {
     return GetRecipe((ModelId<IRecipe>)null);
 }
예제 #8
0
 public static IRecipe GetRecipeNoThrow(this IRecipeService service, ICandidateKey id)
 {
     try
      {
     return service.GetRecipe (id);
      }
      catch
      {
     return null;
      }
 }
예제 #9
0
 public IRecipe GetRecipe(ICandidateKey recipeId)
 {
     return(GetRecipe((ModelId <IRecipe>)null));
 }