Пример #1
0
        public void AddIPScanResults(List<IPScanResult> results)
        {
            if (results == null || results.Count == 0)
            {
                throw new MobileException("非法的results参数,results 不能为空.");
            }

            using (var dbContext = new DataEntities())
            {
                foreach (var item in results)
                {
                    var dbItem = new ipscanresults
                    {
                        CreatedBy = item.CreatedBy,
                        CreatedDate = DateTime.Now,
                        LastUpdatedBy = item.LastUpdatedBy,
                        LastUpdatedDate = DateTime.Now,
                        IP = item.IP,
                        TCPTime = item.TCPResponseTime,
                        TCPValidation = item.TCPValidationResult,
                        TTLValidation = item.TTLValidationResult
                    };

                    dbContext.ipscanresults.AddObject(dbItem);
                }
                dbContext.SaveChanges();
            }
        }
Пример #2
0
 /// <summary>
 /// 用于向 ipscanresults EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet&lt;T&gt; 属性的 .Add 方法。
 /// </summary>
 public void AddToipscanresults(ipscanresults ipscanresults)
 {
     base.AddObject("ipscanresults", ipscanresults);
 }
Пример #3
0
 /// <summary>
 /// 创建新的 ipscanresults 对象。
 /// </summary>
 /// <param name="id">ID 属性的初始值。</param>
 /// <param name="iP">IP 属性的初始值。</param>
 /// <param name="tCPTime">TCPTime 属性的初始值。</param>
 /// <param name="tCPValidation">TCPValidation 属性的初始值。</param>
 /// <param name="tTLValidation">TTLValidation 属性的初始值。</param>
 /// <param name="createdDate">CreatedDate 属性的初始值。</param>
 /// <param name="createdBy">CreatedBy 属性的初始值。</param>
 /// <param name="lastUpdatedDate">LastUpdatedDate 属性的初始值。</param>
 /// <param name="lastUpdatedBy">LastUpdatedBy 属性的初始值。</param>
 public static ipscanresults Createipscanresults(global::System.Int64 id, global::System.String iP, global::System.Int32 tCPTime, global::System.String tCPValidation, global::System.String tTLValidation, global::System.DateTime createdDate, global::System.String createdBy, global::System.DateTime lastUpdatedDate, global::System.String lastUpdatedBy)
 {
     ipscanresults ipscanresults = new ipscanresults();
     ipscanresults.ID = id;
     ipscanresults.IP = iP;
     ipscanresults.TCPTime = tCPTime;
     ipscanresults.TCPValidation = tCPValidation;
     ipscanresults.TTLValidation = tTLValidation;
     ipscanresults.CreatedDate = createdDate;
     ipscanresults.CreatedBy = createdBy;
     ipscanresults.LastUpdatedDate = lastUpdatedDate;
     ipscanresults.LastUpdatedBy = lastUpdatedBy;
     return ipscanresults;
 }