Example #1
0
 public static void Include(DefaultViewModel d)
 {
     using (var context = new Model1())
     {
         var t = ModelToEntity(d);
         context.Entry(t).State = System.Data.Entity.EntityState.Added;
         context.SaveChanges();
     }
 }
Example #2
0
        static Table_1 ModelToEntity(DefaultViewModel d)
        {
            Table_1 t = null;

            if (d != null)
            {
                t             = new Table_1();
                t.id          = d.Id;
                t.description = d.Description;
            }
            return(t);
        }