Example #1
0
        private void UpdateEntity()
        {
            using(var context = new AWMOdel.AWEntities())
            {
                var query = context.tblTipos_Instrumentos.First(c => c.iTipoInstrumento == 0);
                query.sDescripcion = "Updated By Entity F";
                context.SaveChanges();

            }
        }
Example #2
0
        private void DeleteEntity()
        {
            using (var context = new AWMOdel.AWEntities())
            {
                var query = from f in context.tblTipos_Instrumentos where f.sDescripcion == "Descripcion Insertada Entity" select f;
                foreach(var order in query)
                {
                    context.tblTipos_Instrumentos.Remove(order);
                }

                context.SaveChanges();
            }
        }
Example #3
0
        private void InsertEntity()
        {
            using (var context = new AWMOdel.AWEntities())
            {

                tblTipos_Instrumentos ins = new tblTipos_Instrumentos();
                ins.iSubtipo = 5;
                ins.iTipoInstrumento = 0;
                ins.sDescripcion = "Nuevo Insert Entity";

                context.tblTipos_Instrumentos.Add(new tblTipos_Instrumentos
                {
                    sDescripcion = "Descripcion Insertada Entity t",
                    iTipoInstrumento = 0,
                    iSubtipo = 4
                });
                context.tblTipos_Instrumentos.Add(ins);
                context.SaveChanges();
            }
        }