Exemplo n.º 1
0
 public static void CreateDbEntry(UserStory userStory, List <Criteria> criterias = null)
 {
     using (var db = new StoryDbContext())
     {
         db.Stories.Add(userStory);
         if (criterias != null)
         {
             db.Criterias.AddRange(criterias);
         }
         db.SaveChanges();
     }
 }
Exemplo n.º 2
0
        public static UserStory SearchStoryById(string uid)
        {
            UserStory result;

            using (var db = new StoryDbContext())
            {
                var query = from s in db.Stories where s.Id == uid select s;
                result = query.ToList()[0];
            }

            return(result);
        }