Пример #1
0
        public static IEnumerable<Sugestao> FindAll()
        {
            using (var context = new MyContext())
            {
                var all = context.Sugestoes.ToList();

                return all;
            }
        }
Пример #2
0
 public void Create()
 {
     using (var context = new MyContext())
     {
         this.DataCriacao = DateTime.Now;
         var entity = context.Sugestoes.Add(this);
         context.SaveChanges();
     }
 }
Пример #3
0
        public static Sugestao Find(int id)
        {
            using (var context = new MyContext())
            {
                var entity = context.Sugestoes.Find(id);

                return entity;
            }
        }