bool ICommon <AddressBookApplicationInfo> .Update(AddressBookApplicationInfo application) { Contract.Requires <ArgumentNullException>(application != null, "参数application:不能为空"); bool result = false; int count = 0; string message = string.Empty; try { result = dbService.Update(application, out count, out message); } catch (Exception ex) { Config.IlogicLogService.Write(new LogicLog() { AppName = Config.AppName, ClassName = ClassName, NamespaceName = NamespaceName, MethodName = MethodBase.GetCurrentMethod().Name, Message = ex.Message, Oper = Config.Oper }); } if (result == true) { DeleteCache(o => o.ID == application.ID); } return(result); }
AddressBookApplicationInfo ICommon <AddressBookApplicationInfo> .GetInformation(string id) { Contract.Requires <ArgumentNullException>(!string.IsNullOrEmpty(id), "参数id:不能为空"); AddressBookApplicationInfo result = null; string message = string.Empty; try { result = subitems.Find(o => o.ID == id); if (result == null) { result = dbService.GetInformation(new AddressBookApplicationInfo { ID = id }, out message); if (result != null) { List <AddressBookApplicationInfo> cache = new List <AddressBookApplicationInfo>(); cache.Add(result); InsertCaches(cache); } } else { string serializer = Config.Serializer.Serialize(result); result = Config.Serializer.Deserialize <AddressBookApplicationInfo>(serializer); } } catch (Exception ex) { Config.IlogicLogService.Write(new LogicLog() { AppName = Config.AppName, ClassName = ClassName, NamespaceName = NamespaceName, MethodName = MethodBase.GetCurrentMethod().Name, Message = ex.Message, Oper = Config.Oper }); } return(result); }