zoukankan      html  css  js  c++  java
  • EF的增删改查

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Data;
    namespace EF_Exercise
    {
        class Program
        {
            static void Main(string[] args)
            {
             Heima3DbShitEntities db = new Heima3DbShitEntities();
             Customer custom =new Customer();
                //添加实体
                db.Customer.AddObject(custom);
                //删除和修改 Id现行
                custom.ID = 22;
                db.ObjectStateManager.ChangeObjectState(custom, EntityState.Modified);
                db.ObjectStateManager.ChangeObjectState(custom, EntityState.Deleted);
                //Lambda查询
                var data = db.Customer.Where(t => t.ID > 10);
                //Linq查询
                var data1 = from c in db.Customer
                            where c.ID > 10
                            select c;
            }
        }
    }
  • 相关阅读:
    html 问题
    bookshelf
    requireJS 用法
    autoprefixer
    移动端 代码块
    D3 学习资源
    折线图
    iscroll 4 下拉 上拉 加载
    iscroll
    重金悬赏的微软:提交Win8漏洞以及发布Win8应用
  • 原文地址:https://www.cnblogs.com/nieyulin123/p/3149911.html
Copyright © 2011-2022 走看看