public refPersMaritalStatus GetObjectByKey(object keypair)
        {
            if (this.Contains(GetKey(keypair)) == false)
            {
                return(null);
            }
            refPersMaritalStatus ob = this[GetKey(keypair)];

            return((refPersMaritalStatus)ob);
        }
        public refPersMaritalStatus GetObjectByKey(long k_PersMaritalStatusID)
        {
            if (this.Contains(GetKey(k_PersMaritalStatusID)) == false)
            {
                return(null);
            }
            refPersMaritalStatus ob = this[GetKey(k_PersMaritalStatusID)];

            return((refPersMaritalStatus)ob);
        }
        public refPersMaritalStatus GetObjectByKey(KeyValuePair <string, long> keypair)
        {
            if (this.Contains(keypair) == false)
            {
                return(null);
            }
            refPersMaritalStatus ob = this[keypair];

            return((refPersMaritalStatus)ob);
        }
        public bool ChangeItem(KeyValuePair <string, long> keypair, refPersMaritalStatus item)
        {
            refPersMaritalStatus orig = this.GetObjectByKey(keypair);

            if (orig != null)
            {
                int index = this.IndexOf(orig);
                this.SetItem(index, item);

                return(true);
            }

            return(false);
        }
        public refPersMaritalStatus GetObjectByKey(long k_PersMaritalStatusID, LV.Core.DAL.Base.IRepository repository)
        {
            if (this.Contains(GetKey(k_PersMaritalStatusID)) == false)
            {
                refPersMaritalStatus ob = repository.GetQuery <refPersMaritalStatus>().FirstOrDefault(o => o.PersMaritalStatusID == k_PersMaritalStatusID);
                if (ob != null)
                {
                    this.Add(ob);
                }
                return(ob);
            }
            refPersMaritalStatus obj = this[GetKey(k_PersMaritalStatusID)];

            return((refPersMaritalStatus)obj);
        }
        public bool DeleteObject(refPersMaritalStatus item, LV.Core.DAL.Base.IRepository repository)
        {
            repository.Update(item);

            return(true);
        }
        public bool AddObject(refPersMaritalStatus item, LV.Core.DAL.Base.IRepository repository)
        {
            repository.Add(item);

            return(true);
        }
 protected override KeyValuePair <string, long> GetKeyForItem(refPersMaritalStatus item)
 {
     return(item.Key);
 }