Esempio n. 1
0
        public bool UpdateData <IDType> (IMyRepositoryEntity <IDType, string> _data)
        {
            if (!string.IsNullOrWhiteSpace(file.FindLine($"ID{_data.ID}")))
            {
                file.UpdateLine(_data.SaveEntity(), file.GetLineNumber(file.FindLine($"ID{Common.Generics.Converter.CastGeneric<IDType, int> (_data.ID)}")));
                return(true);
            }

            return(false);
        }
Esempio n. 2
0
        public bool DeleteData <IDType> (IMyRepositoryEntity <IDType, string> _entity)
        {
            if (GetDataByIdentifier(_entity.ID) != null)
            {
                file.DeleteLine(file.GetLineNumber(file.FindLine(_entity.ID.ToString())));
                return(true);
            }

            return(false);
        }
Esempio n. 3
0
        public bool InsertData <IDType> (IMyRepositoryEntity <IDType, string> _data)
        {
            if (GetDataByIdentifier(_data.ID) == null)
            {
                file.WriteLine(_data.SaveEntity(), true);

                return(true);
            }

            return(false);
        }